[tor-commits] [sbws/master] Stop returning 1 result as seconds away from other

juga at torproject.org juga at torproject.org
Tue Oct 16 13:04:44 UTC 2018


commit 5500ddf569a5adf5168e7703b64c1283041f4bce
Author: juga0 <juga at riseup.net>
Date:   Mon Oct 15 11:04:54 2018 +0000

    Stop returning 1 result as seconds away from other
---
 sbws/lib/v3bwfile.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index 6fe5a20..6e06c6b 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -339,6 +339,10 @@ class V3BWLine(object):
         for r in reversed(results[:-1]):
             if abs(results_away[0].time - r.time) > secs_away:
                 results_away.insert(0, r)
+        # if there is only 1 result, is the one inserted at the beginning,
+        # so there are no results away from each other
+        if len(results_away) < 2:
+            return None
         return results_away
 
     @staticmethod





More information about the tor-commits mailing list