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

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



commit 4b7845a847d48288ff1ab1008b68e4ea77a35ddd
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
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



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