From 8f4b8053aae282d46221f1008d559d1312db0b9d Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 27 Apr 2022 13:59:29 +0200 Subject: Fixing TimeStampedBuffer get_last_before function --- src/argaze/DataStructures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/argaze/DataStructures.py b/src/argaze/DataStructures.py index 51d245c..44c2583 100644 --- a/src/argaze/DataStructures.py +++ b/src/argaze/DataStructures.py @@ -91,7 +91,7 @@ class TimeStampedBuffer(collections.OrderedDict): ts_list = list(self.keys()) last_before_index = bisect.bisect_left(ts_list, ts) - 1 - if last_before_index > 0: + if last_before_index >= 0: return ts_list[last_before_index] -- cgit v1.1