diff options
author | Nicko van Someren <nicko@nicko.org> | 2019-11-20 18:53:07 -0700 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-12-29 00:06:02 +1100 |
commit | 10709846f38f8f6519dee27694ce583926a00cb9 (patch) | |
tree | 0a04b68f5d7dc440bcc7b41f763cda21912ab100 /py/objslice.c | |
parent | 4c93955b7b4d3d860aed1551ca6231ac4e388e69 (diff) |
py/objslice: Inline fetching of slice paramters in str_subscr().
To reduce code size.
Diffstat (limited to 'py/objslice.c')
-rw-r--r-- | py/objslice.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/py/objslice.c b/py/objslice.c index d17dbf605..86ee03ec5 100644 --- a/py/objslice.c +++ b/py/objslice.c @@ -34,13 +34,6 @@ #if MICROPY_PY_BUILTINS_SLICE -typedef struct _mp_obj_slice_t { - mp_obj_base_t base; - mp_obj_t start; - mp_obj_t stop; - mp_obj_t step; -} mp_obj_slice_t; - STATIC void slice_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { (void)kind; mp_obj_slice_t *o = MP_OBJ_TO_PTR(o_in); @@ -119,14 +112,6 @@ mp_obj_t mp_obj_new_slice(mp_obj_t ostart, mp_obj_t ostop, mp_obj_t ostep) { return MP_OBJ_FROM_PTR(o); } -void mp_obj_slice_get(mp_obj_t self_in, mp_obj_t *start, mp_obj_t *stop, mp_obj_t *step) { - assert(mp_obj_is_type(self_in, &mp_type_slice)); - mp_obj_slice_t *self = MP_OBJ_TO_PTR(self_in); - *start = self->start; - *stop = self->stop; - *step = self->step; -} - // Return the real index and step values for a slice when applied to a sequence of // the given length, resolving missing components, negative values and values off // the end of the sequence. |