Optimize as per TODO (thanks Damien!)

pull/671/head
Chris Angelico 2014-06-12 02:18:54 +10:00
rodzic 5bf0153eca
commit 99dc21b67a
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -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);
}