summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorChris Angelico <rosuav@gmail.com>2014-06-10 03:59:55 +1000
committerChris Angelico <rosuav@gmail.com>2014-06-10 03:59:55 +1000
commit1f44e118f034a38fcb96624bb16ffa32d569c28c (patch)
tree2cb06a974d336d6b454abe34c2e7bb110e14e97b
parent195de3247b0a02df9098b45551b0d5e8d9b06a33 (diff)
downloadmicropython-1f44e118f034a38fcb96624bb16ffa32d569c28c.tar.gz
micropython-1f44e118f034a38fcb96624bb16ffa32d569c28c.zip
Remove unnecessary bounds check from mp_seq_get_fast_slice_indexes.
At this point, start will be >= 0, so checking if stop < 0 is redundant with checking if start > stop a few lines later.
-rw-r--r--py/sequence.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/py/sequence.c b/py/sequence.c
index c73f3baba1..df82488119 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -80,10 +80,6 @@ bool mp_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, mp_bound_
}
if (stop < 0) {
stop = len + stop;
- // CPython returns empty sequence in such case
- if (stop < 0) {
- stop = start;
- }
} else if (stop > len) {
stop = len;
}