Skip to content
Snippets Groups Projects
Commit 62f7ba7a authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

Merge pull request #675 from Rosuav/seq_simplify

Remove unnecessary bounds check from mp_seq_get_fast_slice_indexes.
parents 195de324 1f44e118
No related branches found
No related tags found
No related merge requests found
...@@ -80,10 +80,6 @@ bool mp_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, mp_bound_ ...@@ -80,10 +80,6 @@ bool mp_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, mp_bound_
} }
if (stop < 0) { if (stop < 0) {
stop = len + stop; stop = len + stop;
// CPython returns empty sequence in such case
if (stop < 0) {
stop = start;
}
} else if (stop > len) { } else if (stop > len) {
stop = len; stop = len;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment