summaryrefslogtreecommitdiffstatshomepage
path: root/py/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/map.c')
-rw-r--r--py/map.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/map.c b/py/map.c
index 933b5f8e29..5b9e803774 100644
--- a/py/map.c
+++ b/py/map.c
@@ -1,4 +1,5 @@
#include <stdlib.h>
+#include <assert.h>
#include "misc.h"
#include "mpconfig.h"
@@ -285,7 +286,7 @@ mp_obj_t mp_set_lookup(mp_set_t *set, mp_obj_t index, mp_map_lookup_kind_t looku
mp_obj_t mp_set_remove_first(mp_set_t *set) {
for (uint pos = 0; pos < set->alloc; pos++) {
- if (set->table[pos] != MP_OBJ_NULL && set->table[pos] != MP_OBJ_SENTINEL) {
+ if (MP_SET_SLOT_IS_FILLED(set, pos)) {
mp_obj_t elem = set->table[pos];
// delete element
set->used--;