From e4af71212550d950269f6991be187f41dcf64eee Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 21 Dec 2016 11:46:27 +1100 Subject: py/objint: Rename mp_obj_int_as_float to mp_obj_int_as_float_impl. And also simplify it to remove the check for small int. This can be done because this function is only ever called if the argument is not a small int. --- py/objint_longlong.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'py/objint_longlong.c') diff --git a/py/objint_longlong.c b/py/objint_longlong.c index b051cfbe6..f5b5d9c93 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -295,13 +295,10 @@ mp_int_t mp_obj_int_get_checked(mp_const_obj_t self_in) { } #if MICROPY_PY_BUILTINS_FLOAT -mp_float_t mp_obj_int_as_float(mp_obj_t self_in) { - if (MP_OBJ_IS_SMALL_INT(self_in)) { - return MP_OBJ_SMALL_INT_VALUE(self_in); - } else { - mp_obj_int_t *self = self_in; - return self->val; - } +mp_float_t mp_obj_int_as_float_impl(mp_obj_t self_in) { + assert(MP_OBJ_IS_TYPE(self_in, &mp_type_int)); + mp_obj_int_t *self = self_in; + return self->val; } #endif -- cgit v1.2.3