summaryrefslogtreecommitdiff
path: root/py/objstr.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-25 21:21:57 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-25 21:21:57 +0300
commitde4b9329f99794dc2025a7f9aa203811a156b3c4 (patch)
treecda613e8734bd7821f5ab1380558c103e8f2bbcb /py/objstr.c
parentff4b6daa4f446094361c6bd4cfa557f0ad2565fc (diff)
py: Refactor slice helpers, preparing to support arbitrary slicing.
Diffstat (limited to 'py/objstr.c')
-rw-r--r--py/objstr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 4ec1034e1..84a6f30aa 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -351,11 +351,11 @@ STATIC mp_obj_t str_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
// load
#if MICROPY_PY_SLICE
if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) {
- machine_uint_t start, stop;
- if (!mp_seq_get_fast_slice_indexes(self_len, index, &start, &stop)) {
+ mp_bound_slice_t slice;
+ if (!mp_seq_get_fast_slice_indexes(self_len, index, &slice)) {
assert(0);
}
- return str_new(type, self_data + start, stop - start);
+ return str_new(type, self_data + slice.start, slice.stop - slice.start);
}
#endif
uint index_val = mp_get_index(type, self_len, index, false);