Skip to content

Commit 2ae6697

Browse files
committed
py/objstringio: Add TODO comment about avoiding copying on .getvalue().
1 parent 772c73f commit 2ae6697

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

py/objstringio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ STATIC mp_uint_t stringio_write(mp_obj_t o_in, const void *buf, mp_uint_t size,
9595
STATIC mp_obj_t stringio_getvalue(mp_obj_t self_in) {
9696
mp_obj_stringio_t *self = MP_OBJ_TO_PTR(self_in);
9797
check_stringio_is_open(self);
98+
// TODO: Try to avoid copying string
9899
return mp_obj_new_str_of_type(STREAM_TO_CONTENT_TYPE(self), (byte*)self->vstr->buf, self->vstr->len);
99100
}
100101
STATIC MP_DEFINE_CONST_FUN_OBJ_1(stringio_getvalue_obj, stringio_getvalue);

0 commit comments

Comments
 (0)