We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09547f0 commit 0e420d4Copy full SHA for 0e420d4
py/map.c
@@ -148,11 +148,8 @@ STATIC void mp_map_rehash(mp_map_t *map) {
148
// MP_MAP_LOOKUP_REMOVE_IF_FOUND behaviour:
149
// - returns NULL if not found, else the slot if was found in with key null and value non-null
150
mp_map_elem_t *mp_map_lookup(mp_map_t *map, mp_obj_t index, mp_map_lookup_kind_t lookup_kind) {
151
-
152
- if (map->is_fixed && lookup_kind != MP_MAP_LOOKUP) {
153
- // can't add/remove from a fixed array
154
- return NULL;
155
- }
+ // If the map is a fixed array then we must only be called for a lookup
+ assert(!map->is_fixed || lookup_kind == MP_MAP_LOOKUP);
156
157
// Work out if we can compare just pointers
158
bool compare_only_ptrs = map->all_keys_are_qstrs;
0 commit comments