Commit bf271401 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py: More mp_identity usage.

parent ab7bf284
......@@ -99,10 +99,6 @@ void gen_instance_print(void (*print)(void *env, const char *fmt, ...), void *en
print(env, "<generator object '%s' at %p>", mp_obj_code_get_name(self->code_info), self_in);
}
mp_obj_t gen_instance_getiter(mp_obj_t self_in) {
return self_in;
}
mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_value, mp_obj_t throw_value, mp_obj_t *ret_val) {
assert(MP_OBJ_IS_TYPE(self_in, &mp_type_gen_instance));
mp_obj_gen_instance_t *self = self_in;
......@@ -251,7 +247,7 @@ const mp_obj_type_t mp_type_gen_instance = {
{ &mp_type_type },
.name = MP_QSTR_generator,
.print = gen_instance_print,
.getiter = gen_instance_getiter,
.getiter = mp_identity,
.iternext = gen_instance_iternext,
.locals_dict = (mp_obj_t)&gen_instance_locals_dict,
};
......
......@@ -56,10 +56,6 @@ STATIC mp_obj_t map_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_
return o;
}
STATIC mp_obj_t map_getiter(mp_obj_t self_in) {
return self_in;
}
STATIC mp_obj_t map_iternext(mp_obj_t self_in) {
assert(MP_OBJ_IS_TYPE(self_in, &mp_type_map));
mp_obj_map_t *self = self_in;
......@@ -80,6 +76,6 @@ const mp_obj_type_t mp_type_map = {
{ &mp_type_type },
.name = MP_QSTR_map,
.make_new = map_make_new,
.getiter = map_getiter,
.getiter = mp_identity,
.iternext = map_iternext,
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment