From 48ac075160ed425a35b74743612ab6b5916e9a04 Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 16 Jul 2021 14:56:19 +0200 Subject: ext.accumulator: Use max rather than branch --- ranger/ext/accumulator.py | 3 +-- 1 file changed, 1 insertion(+), 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] -- cgit 1.4.1-2-gfad0