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.
pull/675/head
Chris Angelico 2014-06-10 03:59:55 +10:00
rodzic 195de3247b
commit 1f44e118f0
1 zmienionych plików z 0 dodań i 4 usunięć

Wyświetl plik

@ -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;
}