py/map: Replace always-false condition with assertion.

pull/3294/head
Damien George 2017-08-31 16:45:02 +10:00
rodzic 09547f0f51
commit 0e420d48ee
1 zmienionych plików z 2 dodań i 5 usunięć

Wyświetl plik

@ -148,11 +148,8 @@ STATIC void mp_map_rehash(mp_map_t *map) {
// MP_MAP_LOOKUP_REMOVE_IF_FOUND behaviour:
// - returns NULL if not found, else the slot if was found in with key null and value non-null
mp_map_elem_t *mp_map_lookup(mp_map_t *map, mp_obj_t index, mp_map_lookup_kind_t lookup_kind) {
if (map->is_fixed && lookup_kind != MP_MAP_LOOKUP) {
// can't add/remove from a fixed array
return NULL;
}
// 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);
// Work out if we can compare just pointers
bool compare_only_ptrs = map->all_keys_are_qstrs;