diff options
author | Damien George <damien.p.george@gmail.com> | 2016-09-19 12:20:41 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-09-19 12:28:55 +1000 |
commit | 8dd5960ac0853ca2a73dd394511f80f3dd3d38cb (patch) | |
tree | 2d8576cb670b19502adec244cc525f43626f96c6 | |
parent | 5da0d29d3cefa6a3cac52e0db96e9ede820d6a51 (diff) | |
download | micropython-8dd5960ac0853ca2a73dd394511f80f3dd3d38cb.tar.gz micropython-8dd5960ac0853ca2a73dd394511f80f3dd3d38cb.zip |
py/objnone: Use mp_generic_unary_op instead of custom one.
-rw-r--r-- | py/objnone.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/py/objnone.c b/py/objnone.c index 74c02e4d29..5d5b83540d 100644 --- a/py/objnone.c +++ b/py/objnone.c @@ -43,20 +43,11 @@ STATIC void none_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_ } } -STATIC mp_obj_t none_unary_op(mp_uint_t op, mp_obj_t o_in) { - (void)o_in; - switch (op) { - // MP_UNARY_OP_BOOL is handled by a fast-path in mp_obj_is_true - case MP_UNARY_OP_HASH: return MP_OBJ_NEW_SMALL_INT((mp_uint_t)o_in); - default: return MP_OBJ_NULL; // op not supported - } -} - const mp_obj_type_t mp_type_NoneType = { { &mp_type_type }, .name = MP_QSTR_NoneType, .print = none_print, - .unary_op = none_unary_op, + .unary_op = mp_generic_unary_op, }; const mp_obj_none_t mp_const_none_obj = {{&mp_type_NoneType}}; |