8000 objlist: Use static small int constructor. · lurch/micropython@48bf6b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 48bf6b3

Browse files
committed
objlist: Use static small int constructor.
1 parent 708c073 commit 48bf6b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/objlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ STATIC mp_obj_t list_pop(uint n_args, const mp_obj_t *args) {
196196
if (self->len == 0) {
197197
nlr_raise(mp_obj_new_excep 601C tion_msg(&mp_type_IndexError, "pop from empty list"));
198198
}
199-
uint index = mp_get_index(self->base.type, self->len, n_args == 1 ? mp_obj_new_int(-1) : args[1], false);
199+
uint index = mp_get_index(self->base.type, self->len, n_args == 1 ? MP_OBJ_NEW_SMALL_INT(-1) : args[1], false);
200200
mp_obj_t ret = self->items[index];
201201
self->len -= 1;
202202
memcpy(self->items + index, self->items + index + 1, (self->len - index) * sizeof(mp_obj_t));

0 commit comments

Comments
 (0)
0