skip converting from long int if long ints aren't enabled

.. saves 20 bytes on proxlight trinkey
This commit is contained in:
Jeff Epler 2022-11-14 21:25:33 -06:00
parent 2d08473ee0
commit 14ba5a75a3
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
1 changed files with 2 additions and 0 deletions

View File

@ -143,8 +143,10 @@ void common_hal_adafruit_pixelbuf_pixelbuf_set_brightness(mp_obj_t self_in, mp_f
STATIC uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) {
if (mp_obj_is_small_int(obj)) {
return MP_OBJ_SMALL_INT_VALUE(obj);
#if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE
} else if (mp_obj_is_int(obj)) {
return mp_obj_get_int_truncated(obj);
#endif
} else if (mp_obj_is_float(obj)) {
return (uint8_t)mp_obj_get_float(obj);
}