py/parsenum: Optimise when building with complex disabled.
To reduce code size when MICROPY_PY_BUILTINS_COMPLEX is disabled. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -83,7 +83,7 @@ STATIC mp_obj_t complex_make_new(const mp_obj_type_t *type_in, size_t n_args, si
|
||||
// a string, parse it
|
||||
size_t l;
|
||||
const char *s = mp_obj_str_get_data(args[0], &l);
|
||||
return mp_parse_num_decimal(s, l, true, true, NULL);
|
||||
return mp_parse_num_complex(s, l, NULL);
|
||||
} else if (mp_obj_is_type(args[0], &mp_type_complex)) {
|
||||
// a complex, just return it
|
||||
return args[0];
|
||||
|
||||
Reference in New Issue
Block a user