aboutsummaryrefslogtreecommitdiff
path: root/py/objstringio.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-25 22:34:34 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-25 22:34:34 +0100
commitf600a6a0851bc2023e9322bac807f5d2217e8451 (patch)
tree6bcc71e3650af453838e5e54fbc1cc1c95623c3a /py/objstringio.c
parent2617eebf2ff77e58f415162300747eaf1a5ab5d7 (diff)
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_.
Diffstat (limited to 'py/objstringio.c')
-rw-r--r--py/objstringio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objstringio.c b/py/objstringio.c
index 7a3e0f893..d9ad604b4 100644
--- a/py/objstringio.c
+++ b/py/objstringio.c
@@ -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);