[tor-commits] [arm/release] Use explicit counting to remove dependency on scoping rules.

atagar at torproject.org atagar at torproject.org
Sun Jul 17 06:08:31 UTC 2011


commit f213ff7a9ecefe197faa91b980aa8a67819bdf4b
Author: Kamran Riaz Khan <krkhan at inspirated.com>
Date:   Sat Jul 9 16:55:24 2011 +0500

    Use explicit counting to remove dependency on scoping rules.
---
 src/gui/connections/connPanel.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gui/connections/connPanel.py b/src/gui/connections/connPanel.py
index ad57878..9df5142 100644
--- a/src/gui/connections/connPanel.py
+++ b/src/gui/connections/connPanel.py
@@ -44,9 +44,11 @@ class ConnectionPanel(CliConnectionPanel):
     treestore = self.builder.get_object('treestore_conn')
 
     # first pass checks whether we have enough entries cached to not update the treeview
-    for (index, line) in enumerate(self._entryLines):
+    index = 0
+    for line in self._entryLines:
       local = "%s:%s" % (line.local.ipAddr, line.local.port)
       foreign = "%s:%s" % (line.foreign.ipAddr, line.foreign.port)
+
       cachekey = (local, foreign)
       if self.cache.has_key(cachekey):
         timeLabel = "%d s" % (time.time() - line.startTime)
@@ -54,7 +56,9 @@ class ConnectionPanel(CliConnectionPanel):
       else:
         break
 
-    if index == len(self._entryLines) - 1:
+      index = index + 1
+
+    if index == len(self._entryLines):
       return
 
     treestore.clear()





More information about the tor-commits mailing list