py: Use SMALL_INT creation macro in builtin sum.

This commit is contained in:
Damien George 2015-03-02 17:19:44 +00:00
parent 96e37d3bb8
commit db1e10d5ea
1 changed files with 1 additions and 1 deletions

View File

@ -492,7 +492,7 @@ STATIC mp_obj_t mp_builtin_sum(mp_uint_t n_args, const mp_obj_t *args) {
assert(1 <= n_args && n_args <= 2); assert(1 <= n_args && n_args <= 2);
mp_obj_t value; mp_obj_t value;
switch (n_args) { switch (n_args) {
case 1: value = mp_obj_new_int(0); break; case 1: value = MP_OBJ_NEW_SMALL_INT(0); break;
default: value = args[1]; break; default: value = args[1]; break;
} }
mp_obj_t iterable = mp_getiter(args[0]); mp_obj_t iterable = mp_getiter(args[0]);