py: Slightly improve efficiency of mp_obj_new_str; rename str_new.
Reorder interning logic in mp_obj_new_str, to be more efficient. str_new is globally accessible, so should be prefixed with mp_obj_.
This commit is contained in:
@@ -83,7 +83,7 @@ STATIC machine_int_t stringio_write(mp_obj_t o_in, const void *buf, machine_uint
|
||||
|
||||
STATIC mp_obj_t stringio_getvalue(mp_obj_t self_in) {
|
||||
mp_obj_stringio_t *self = self_in;
|
||||
return str_new(STREAM_TO_CONTENT_TYPE(self), (byte*)self->vstr->buf, self->vstr->len);
|
||||
return mp_obj_new_str_of_type(STREAM_TO_CONTENT_TYPE(self), (byte*)self->vstr->buf, self->vstr->len);
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(stringio_getvalue_obj, stringio_getvalue);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user