summaryrefslogtreecommitdiff
path: root/py/parsenum.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-08-23 18:35:37 +1000
committerDamien George <damien@micropython.org>2022-08-26 16:44:35 +1000
commit3a910b15650636efc58bce48cc1bfa0debfd375c (patch)
treed93e2e0dcb591a1724424f6ed5e07a6bb251d67a /py/parsenum.c
parent88864587f5af292d7f86aceb6bf40e8331e9a8d6 (diff)
py/objstr: Optimise mp_obj_new_str_from_vstr for known-safe strings.
The new `mp_obj_new_str_from_utf8_vstr` can be used when you know you already have a unicode-safe string. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/parsenum.c')
-rw-r--r--py/parsenum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/parsenum.c b/py/parsenum.c
index 79765f84f..d59715fdc 100644
--- a/py/parsenum.c
+++ b/py/parsenum.c
@@ -160,7 +160,7 @@ value_error:
mp_printf(&print, "invalid syntax for integer with base %d: ", base);
mp_str_print_quoted(&print, str_val_start, top - str_val_start, true);
mp_obj_t exc = mp_obj_new_exception_arg1(&mp_type_ValueError,
- mp_obj_new_str_from_vstr(&vstr));
+ mp_obj_new_str_from_utf8_vstr(&vstr));
raise_exc(exc, lex);
#endif
}