summaryrefslogtreecommitdiff
path: root/py/objdict.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2020-10-09 17:10:29 +1100
committerDamien George <damien@micropython.org>2020-10-10 00:16:26 +1100
commit880875bea1d825b8fa0d1c4a779ff767377f7655 (patch)
tree1845029fd301195bae073c78b3a8535560b3d286 /py/objdict.c
parentfa12bfc227be47a10314576f02ee9d9cb2c1d67c (diff)
py/objdict: Add mp_const_empty_dict_obj, use it for mp_const_empty_map.
Diffstat (limited to 'py/objdict.c')
-rw-r--r--py/objdict.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/py/objdict.c b/py/objdict.c
index 4fa59f463..4e51f259e 100644
--- a/py/objdict.c
+++ b/py/objdict.c
@@ -33,6 +33,18 @@
#include "py/objtype.h"
#include "py/objstr.h"
+const mp_obj_dict_t mp_const_empty_dict_obj = {
+ .base = { .type = &mp_type_dict },
+ .map = {
+ .all_keys_are_qstrs = 0,
+ .is_fixed = 1,
+ .is_ordered = 1,
+ .used = 0,
+ .alloc = 0,
+ .table = NULL,
+ }
+};
+
STATIC mp_obj_t dict_update(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs);
// This is a helper function to iterate through a dictionary. The state of