[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [sbws/master] Stop returning 1 result as seconds away from other
commit 5500ddf569a5adf5168e7703b64c1283041f4bce
Author: juga0 <juga@xxxxxxxxxx>
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
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits