py/objstr: Remove unnecessary check for positive splits variable.
At this point in the code the variable "splits" is guaranteed to be positive due to the check for "splits == 0" above it.
This commit is contained in:
parent
7e2a48858c
commit
8769049e93
|
@ -663,9 +663,7 @@ STATIC mp_obj_t str_rsplit(size_t n_args, const mp_obj_t *args) {
|
||||||
}
|
}
|
||||||
res->items[idx--] = mp_obj_new_str_of_type(self_type, s + sep_len, last - s - sep_len);
|
res->items[idx--] = mp_obj_new_str_of_type(self_type, s + sep_len, last - s - sep_len);
|
||||||
last = s;
|
last = s;
|
||||||
if (splits > 0) {
|
splits--;
|
||||||
splits--;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (idx != 0) {
|
if (idx != 0) {
|
||||||
// We split less parts than split limit, now go cleanup surplus
|
// We split less parts than split limit, now go cleanup surplus
|
||||||
|
|
Loading…
Reference in New Issue