Skip to content

Commit 8769049

Browse files
committed
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.
1 parent 7e2a488 commit 8769049

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

py/objstr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,7 @@ STATIC mp_obj_t str_rsplit(size_t n_args, const mp_obj_t *args) {
663663
}
664664
res->items[idx--] = mp_obj_new_str_of_type(self_type, s + sep_len, last - s - sep_len);
665665
last = s;
666-
if (splits > 0) {
667-
splits--;
668-
}
666+
splits--;
669667
}
670668
if (idx != 0) {
671669
// We split less parts than split limit, now go cleanup surplus

0 commit comments

Comments
 (0)