summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-12-21 16:24:09 +0000
committerDamien George <damien.p.george@gmail.com>2014-12-21 16:24:09 +0000
commitb063b9b36d6d4bb8eed3140778c9969969db0ec6 (patch)
tree26ee658baae1e8112602f9bb07ca0f03470d7138 /py
parent7b80d908bf5712de67fe37d33cf339781657a4a8 (diff)
downloadmicropython-b063b9b36d6d4bb8eed3140778c9969969db0ec6.tar.gz
micropython-b063b9b36d6d4bb8eed3140778c9969969db0ec6.zip
py: Fix iteration over map in 2 places.
Diffstat (limited to 'py')
-rw-r--r--py/runtime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 0690bd8b05..505c8e31af 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -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
// dictionary
mp_map_t *map = mp_obj_dict_get_map(kw_dict);
assert(args2_len + 2 * map->used <= args2_alloc); // should have enough, since kw_dict_len is in this case hinted correctly above
- for (uint i = 0; i < map->alloc; i++) {
- if (map->table[i].key != MP_OBJ_NULL) {
+ for (mp_uint_t i = 0; i < map->alloc; i++) {
+ if (MP_MAP_SLOT_IS_FILLED(map, i)) {
args2[args2_len++] = map->table[i].key;
args2[args2_len++] = map->table[i].value;
}
@@ -1240,7 +1240,7 @@ void mp_import_all(mp_obj_t module) {
// TODO: Support __all__
mp_map_t *map = mp_obj_dict_get_map(mp_obj_module_get_globals(module));
- for (uint i = 0; i < map->alloc; i++) {
+ for (mp_uint_t i = 0; i < map->alloc; i++) {
if (MP_MAP_SLOT_IS_FILLED(map, i)) {
qstr name = MP_OBJ_QSTR_VALUE(map->table[i].key);
if (*qstr_str(name) != '_') {