From e4d849748c6cd6884da33cf0cf0cdaf8e319cf19 Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Fri, 3 Aug 2007 14:02:28 +0000 Subject: only one instance of while len(...) --- lib/sqlalchemy/topological.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/topological.py b/lib/sqlalchemy/topological.py index dcfe9ea71..87efc802b 100644 --- a/lib/sqlalchemy/topological.py +++ b/lib/sqlalchemy/topological.py @@ -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: -- cgit v1.2.1