py: Stuff qstr in object pointer; keys for mp_map_t are now always mp_obj_t.

This commit is contained in:
Damien George
2014-01-08 17:33:12 +00:00
parent ea9e441a75
commit 38a2da68c2
13 changed files with 135 additions and 123 deletions

View File

@@ -32,8 +32,8 @@ mp_obj_t mp_obj_new_module(qstr module_name) {
mp_obj_module_t *o = m_new_obj(mp_obj_module_t);
o->base.type = &module_type;
o->name = module_name;
o->globals = mp_map_new(MP_MAP_QSTR, 1);
mp_qstr_map_lookup(o->globals, MP_QSTR___name__, true)->value = mp_obj_new_str(module_name);
o->globals = mp_map_new(1);
mp_map_lookup(o->globals, MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = mp_obj_new_str(module_name);
return o;
}