diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-05-13 01:35:52 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-05-14 14:46:13 +0300 |
commit | 2ae6697300ed6954d30d94992fc5ff13e5a93eae (patch) | |
tree | c6ba7b460576114a3c88b3ee3992b33a444b305b | |
parent | 772c73fa16a695a4664568a678e09fcb60daf298 (diff) | |
download | micropython-2ae6697300ed6954d30d94992fc5ff13e5a93eae.tar.gz micropython-2ae6697300ed6954d30d94992fc5ff13e5a93eae.zip |
py/objstringio: Add TODO comment about avoiding copying on .getvalue().
-rw-r--r-- | py/objstringio.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/objstringio.c b/py/objstringio.c index f50abfbc3a..5fd2ca9d3b 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -95,6 +95,7 @@ STATIC mp_uint_t stringio_write(mp_obj_t o_in, const void *buf, mp_uint_t size, STATIC mp_obj_t stringio_getvalue(mp_obj_t self_in) { mp_obj_stringio_t *self = MP_OBJ_TO_PTR(self_in); check_stringio_is_open(self); + // TODO: Try to avoid copying string 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); |