Skip to content

Commit 8dd5960

Browse files
committed
py/objnone: Use mp_generic_unary_op instead of custom one.
1 parent 5da0d29 commit 8dd5960

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

py/objnone.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,11 @@ STATIC void none_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_
4343
}
4444
}
4545

46-
STATIC mp_obj_t none_unary_op(mp_uint_t op, mp_obj_t o_in) {
47-
(void)o_in;
48-
switch (op) {
49-
// MP_UNARY_OP_BOOL is handled by a fast-path in mp_obj_is_true
50-
case MP_UNARY_OP_HASH: return MP_OBJ_NEW_SMALL_INT((mp_uint_t)o_in);
51-
default: return MP_OBJ_NULL; // op not supported
52-
}
53-
}
54-
5546
const mp_obj_type_t mp_type_NoneType = {
5647
{ &mp_type_type },
5748
.name = MP_QSTR_NoneType,
5849
.print = none_print,
59-
.unary_op = none_unary_op,
50+
.unary_op = mp_generic_unary_op,
6051
};
6152

6253
const mp_obj_none_t mp_const_none_obj = {{&mp_type_NoneType}};

0 commit comments

Comments
 (0)