[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] relayprioritizer: add comment about future refactor



commit 603f83adcaff021c8c5ba557a5e61d09c19ca79d
Author: juga0 <juga@xxxxxxxxxx>
Date:   Tue Dec 18 09:16:40 2018 +0000

    relayprioritizer: add comment about future refactor
---
 sbws/lib/relayprioritizer.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sbws/lib/relayprioritizer.py b/sbws/lib/relayprioritizer.py
index 13ed491..e920bd1 100644
--- a/sbws/lib/relayprioritizer.py
+++ b/sbws/lib/relayprioritizer.py
@@ -97,6 +97,7 @@ class RelayPrioritizer:
                     # or create constants.
                     freshness *= max(1.0-result.freshness_reduction_factor, 0)
                 priority += freshness
+            # In a future refactor, do not create a new attribute
             relay.priority = priority
         # Sort the relays by their priority, with the smallest (best) priority
         # relays at the front
@@ -114,5 +115,7 @@ class RelayPrioritizer:
         for relay in relays[0:upper_limit]:
             log.debug('Returning next relay %s with priority %f',
                       relay.nickname, relay.priority)
+            # In a future refactor, a new attribute should not be created,
+            # then no need to remove it.
             del(relay.priority)
             yield relay



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits