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

[tor-commits] [bridgedb/master] Replace a for loop with a list comprehension



commit 4e3aa2db2d00e7b4abded7038a091f1762483302
Author: Robert Ransom <rransom.8774@xxxxxxxxx>
Date:   Mon Mar 23 11:43:22 2015 -0700

    Replace a for loop with a list comprehension
---
 lib/bridgedb/test/legacy_Tests.py |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/bridgedb/test/legacy_Tests.py b/lib/bridgedb/test/legacy_Tests.py
index bf4cf39..ddf30f3 100644
--- a/lib/bridgedb/test/legacy_Tests.py
+++ b/lib/bridgedb/test/legacy_Tests.py
@@ -80,9 +80,7 @@ def randomPortSpec():
     """
     returns a random list of ports
     """
-    ports = []
-    for i in range(0,24):
-        ports.append(random.randint(1,65535))
+    ports = [randomPort() for i in range(0,24)]
     ports.sort(reverse=True)
 
     portspec = ",".join(["%d" % random.choice(ports) for i in range(0,16)])



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