diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-15 00:35:09 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-27 00:04:20 +0300 |
commit | ea2c936c7e6af8e6d8168d039bdf02797b0777bf (patch) | |
tree | c2564560645d8d70a140eb0fa325a2a568e6d299 /py/objstr.c | |
parent | 26fda6dc8ef77e1acdc3529360a6d1cef23608e4 (diff) |
objstrunicode: Refactor str_index_to_ptr() following objstr.
Diffstat (limited to 'py/objstr.c')
-rw-r--r-- | py/objstr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/py/objstr.c b/py/objstr.c index 714a170d0..6ddba18a3 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -344,11 +344,14 @@ uncomparable: return MP_OBJ_NULL; // op not supported } +#if !MICROPY_PY_BUILTINS_STR_UNICODE +// objstrunicode defines own version const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, uint self_len, mp_obj_t index, bool is_slice) { machine_uint_t index_val = mp_get_index(type, self_len, index, is_slice); return self_data + index_val; } +#endif STATIC mp_obj_t str_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { mp_obj_type_t *type = mp_obj_get_type(self_in); |