about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-07-16 14:56:19 +0200
committertoonn <toonn@toonn.io>2021-07-20 23:17:45 +0200
commit48ac075160ed425a35b74743612ab6b5916e9a04 (patch)
tree7cee7dfbd0b69f81d3e925177836345fdc9969ab
parent43584fb3633f1db89ca4857d7a8dd568172ff26f (diff)
downloadranger-48ac075160ed425a35b74743612ab6b5916e9a04.tar.gz
ext.accumulator: Use max rather than branch
-rw-r--r--ranger/ext/accumulator.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/ranger/ext/accumulator.py b/ranger/ext/accumulator.py
index c2e33b59..a41db634 100644
--- a/ranger/ext/accumulator.py
+++ b/ranger/ext/accumulator.py
@@ -75,8 +75,7 @@ class Accumulator(object):
                 i = 0
             if i >= len(lst):
                 i = len(lst) - 1
-            if i < 0:
-                i = 0
+            i = max(0, i)
 
             self.pointer = i
             self.pointed_obj = lst[i]