diff options
author | Damien George <damien.p.george@gmail.com> | 2018-02-20 19:19:02 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-02-20 19:19:02 +1100 |
commit | 8769049e935a89daa51883755457a083a5589d4e (patch) | |
tree | 54398bb55e84727fe4342d0b521e37995f01a106 /py/objstr.c | |
parent | 7e2a48858cec549879ae87384398008d82887766 (diff) |
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.
Diffstat (limited to 'py/objstr.c')
-rw-r--r-- | py/objstr.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/py/objstr.c b/py/objstr.c index 13d957105..c42f38e75 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 |