[tor-commits] [bridgedb/master] Refactor Bridge.supportedTransportTypes property to be shorter and faster.

isis at torproject.org isis at torproject.org
Sat Mar 21 02:03:01 UTC 2015


commit 4b7845a847d48288ff1ab1008b68e4ea77a35ddd
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sat Feb 14 03:41:23 2015 +0000

    Refactor Bridge.supportedTransportTypes property to be shorter and faster.
---
 lib/bridgedb/bridges.py |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py
index b882e5b..5a5cba7 100644
--- a/lib/bridgedb/bridges.py
+++ b/lib/bridgedb/bridges.py
@@ -1274,12 +1274,7 @@ class Bridge(BridgeBackwardsCompatibility):
         """A deduplicated list of all the :data:`PluggableTranport.methodname`s
         which this bridge supports.
         """
-        supported = []
-
-        for transport in self.transports:
-            supported.append(transport.methodname)
-
-        return list(set(supported))
+        return list(set([pt.methodname for pt in self.transports]))
 
     def updateFromNetworkStatus(self, descriptor):
         """Update this bridge's attributes from a parsed networkstatus





More information about the tor-commits mailing list