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>
This commit is contained in:
committed by
Damien George
parent
88864587f5
commit
3a910b1565
@@ -467,7 +467,7 @@ STATIC mp_obj_t mp_builtin_repr(mp_obj_t o_in) {
|
||||
mp_print_t print;
|
||||
vstr_init_print(&vstr, 16, &print);
|
||||
mp_obj_print_helper(&print, o_in, PRINT_REPR);
|
||||
return mp_obj_new_str_from_vstr(&vstr);
|
||||
return mp_obj_new_str_from_utf8_vstr(&vstr);
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_repr_obj, mp_builtin_repr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user