From 99dc21b67a895dc10d3c846bc158d27c839cee48 Mon Sep 17 00:00:00 2001 From: Chris Angelico Date: Thu, 12 Jun 2014 02:18:54 +1000 Subject: [PATCH] Optimize as per TODO (thanks Damien!) --- py/objstr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py/objstr.c b/py/objstr.c index 456f5fe801..b219be6d35 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -457,8 +457,7 @@ STATIC mp_obj_t str_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { pstop = (const char *)self_data + self_len; } if (pstop < pstart) { - // TODO (optimization): Return a hard-coded "" for this. - pstop = pstart; + return MP_OBJ_NEW_QSTR(MP_QSTR_); } return mp_obj_new_str_of_type(type, (const byte *)pstart, pstop - pstart); }