Skip to content

Commit b063b9b

Browse files
committed
py: Fix iteration over map in 2 places.
1 parent 7b80d90 commit b063b9b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

py/runtime.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,8 @@ mp_obj_t mp_call_method_n_kw_var(bool have_self, mp_uint_t n_args_n_kw, const mp
725725
// dictionary
726726
mp_map_t *map = mp_obj_dict_get_map(kw_dict);
727727
assert(args2_len + 2 * map->used <= args2_alloc); // should have enough, since kw_dict_len is in this case hinted correctly above
728-
for (uint i = 0; i < map->alloc; i++) {
729-
if (map->table[i].key != MP_OBJ_NULL) {
728+
for (mp_uint_t i = 0; i < map->alloc; i++) {
729+
if (MP_MAP_SLOT_IS_FILLED(map, i)) {
730730
args2[args2_len++] = map->table[i].key;
731731
args2[args2_len++] = map->table[i].value;
732732
}
@@ -1240,7 +1240,7 @@ void mp_import_all(mp_obj_t module) {
12401240

12411241
// TODO: Support __all__
12421242
mp_map_t *map = mp_obj_dict_get_map(mp_obj_module_get_globals(module));
1243-
for (uint i = 0; i < map->alloc; i++) {
1243+
for (mp_uint_t i = 0; i < map->alloc; i++) {
12441244
if (MP_MAP_SLOT_IS_FILLED(map, i)) {
12451245
qstr name = MP_OBJ_QSTR_VALUE(map->table[i].key);
12461246
if (*qstr_str(name) != '_') {

0 commit comments

Comments
 (0)