git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
a483ab9
)
BUGFIX: list.reverse() is in place, does not return a value
author
Sapan Bhatia
<gwsapan@gmail.com>
Wed, 2 Oct 2013 13:48:42 +0000
(09:48 -0400)
committer
Sapan Bhatia
<gwsapan@gmail.com>
Wed, 2 Oct 2013 13:48:42 +0000
(09:48 -0400)
planetstack/observer/toposort.py
patch
|
blob
|
history
diff --git
a/planetstack/observer/toposort.py
b/planetstack/observer/toposort.py
index
bfedee9
..
959cea3
100755
(executable)
--- a/
planetstack/observer/toposort.py
+++ b/
planetstack/observer/toposort.py
@@
-36,8
+36,9
@@
def toposort(g, steps=None):
if (not v):
sources.append(k)
-
rev_
order = []
+ order = []
marked = []
+
while sources:
n = sources.pop(0)
try:
@@
-48,8
+49,9
@@
def toposort(g, steps=None):
except KeyError:
pass
if (n in steps):
- rev_order.append(n)
- order = rev_order.reverse()
+ order.append(n)
+
+ order.reverse()
return order