diff --git a/py/objstr.c b/py/objstr.c index 13d957105a..c42f38e75b 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -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); last = s; - if (splits > 0) { - splits--; - } + splits--; } if (idx != 0) { // We split less parts than split limit, now go cleanup surplus