mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
py: Change module globals from mp_map_t* to mp_obj_dict_t*.
Towards addressing issue #424. Had a small increase to ROM usage (order 60 bytes).
This commit is contained in:
3
py/map.c
3
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--;
|
||||
|
||||
Reference in New Issue
Block a user