diff options
author | N-R-K <nrk@disroot.org> | 2022-04-27 01:25:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-27 01:25:11 +0000 |
commit | 29c6b1456e8bb46fbee0e8ea962553cb9f1230a3 (patch) | |
tree | 99f72eff053384c0251cac83722ceb5653ed80bf /commands.c | |
parent | 7fb8a61c47b8968f3da7decaefbe55b621e68420 (diff) |
code-style: reduce some unnecessary if-elses (#261)
also change the condition inside img_frame_animate() to check for
positive value rather than comparing against 0.
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -273,10 +273,7 @@ bool ci_navigate(arg_t n) if (prefix > 0) n *= prefix; n += fileidx; - if (n < 0) - n = 0; - if (n >= filecnt) - n = filecnt - 1; + n = MAX(0, MIN(n, filecnt - 1)); if (n != fileidx) { load_image(n); |