mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
py/objint: Extract small int value directly because type is known.
This commit is contained in:
@@ -224,7 +224,7 @@ char *mp_obj_int_formatted(char **buf, size_t *buf_size, size_t *fmt_size, mp_co
|
|||||||
fmt_int_t num;
|
fmt_int_t num;
|
||||||
if (MP_OBJ_IS_SMALL_INT(self_in)) {
|
if (MP_OBJ_IS_SMALL_INT(self_in)) {
|
||||||
// A small int; get the integer value to format.
|
// A small int; get the integer value to format.
|
||||||
num = mp_obj_get_int(self_in);
|
num = MP_OBJ_SMALL_INT_VALUE(self_in);
|
||||||
#if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE
|
#if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE
|
||||||
} else if (MP_OBJ_IS_TYPE(self_in, &mp_type_int)) {
|
} else if (MP_OBJ_IS_TYPE(self_in, &mp_type_int)) {
|
||||||
// Not a small int.
|
// Not a small int.
|
||||||
|
|||||||
Reference in New Issue
Block a user