summaryrefslogtreecommitdiffstatshomepage
path: root/py/sequence.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-07-18 12:45:05 +1000
committerDamien George <damien@micropython.org>2024-07-18 12:51:29 +1000
commit1548132979ab6facd0d3d98fd381c5178330fa20 (patch)
treeceeb66a3af48c7711c1999e2da42ade4b57d1152 /py/sequence.c
parent96007e7de55810b20134b050c80cbc7a6d1d5a57 (diff)
downloadmicropython-1548132979ab6facd0d3d98fd381c5178330fa20.tar.gz
micropython-1548132979ab6facd0d3d98fd381c5178330fa20.zip
py/sequence: Remove unused len argument from mp_seq_extract_slice.
Also put this function inside the `MICROPY_PY_BUILTINS_SLICE` guard, because it's only usable when that option is enabled. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/sequence.c')
-rw-r--r--py/sequence.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/py/sequence.c b/py/sequence.c
index 5838607431..9eb67ada6e 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -63,11 +63,7 @@ bool mp_seq_get_fast_slice_indexes(mp_uint_t len, mp_obj_t slice, mp_bound_slice
return indexes->step == 1;
}
-#endif
-
-mp_obj_t mp_seq_extract_slice(size_t len, const mp_obj_t *seq, mp_bound_slice_t *indexes) {
- (void)len; // TODO can we remove len from the arg list?
-
+mp_obj_t mp_seq_extract_slice(const mp_obj_t *seq, mp_bound_slice_t *indexes) {
mp_int_t start = indexes->start, stop = indexes->stop;
mp_int_t step = indexes->step;
@@ -87,6 +83,8 @@ mp_obj_t mp_seq_extract_slice(size_t len, const mp_obj_t *seq, mp_bound_slice_t
return res;
}
+#endif
+
// Special-case comparison function for sequences of bytes
// Don't pass MP_BINARY_OP_NOT_EQUAL here
bool mp_seq_cmp_bytes(mp_uint_t op, const byte *data1, size_t len1, const byte *data2, size_t len2) {