mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 13:10:21 +01:00
py: Fix delete operation on map/dict and set objects.
Hash table can now be completely full (ie now NULL entry) before a resize is triggered. Use sentinel value to indicate delete entry in the table.
This commit is contained in:
@@ -103,7 +103,7 @@ STATIC mp_map_elem_t *dict_it_iternext_elem(mp_obj_t self_in) {
|
||||
mp_map_elem_t *table = self->dict->map.table;
|
||||
|
||||
for (int i = self->cur; i < max; i++) {
|
||||
if (table[i].key != NULL) {
|
||||
if (table[i].key != MP_OBJ_NULL && table[i].key != MP_OBJ_SENTINEL) {
|
||||
self->cur = i + 1;
|
||||
return &(table[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user