]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
only one instance of while len(...)
authorJonathan Ellis <jbellis@gmail.com>
Fri, 3 Aug 2007 14:02:28 +0000 (14:02 +0000)
committerJonathan Ellis <jbellis@gmail.com>
Fri, 3 Aug 2007 14:02:28 +0000 (14:02 +0000)
lib/sqlalchemy/topological.py

index dcfe9ea7158713bd460c607e1b659357970ea8cd..87efc802bae379d1476b189b42ac78cd5436a20a 100644 (file)
@@ -198,8 +198,8 @@ class QueueDependencySorter(object):
                 queue.append(n)
         cycles = {}
         output = []
-        while len(nodes) > 0:
-            if len(queue) == 0:
+        while nodes:
+            if not queue:
                 # edges remain but no edgeless nodes to remove; this indicates
                 # a cycle
                 if allow_all_cycles: