Skip to content

Commit

Permalink
Merge pull request #1777 from arjclark/validation.reduce_order_calcul…
Browse files Browse the repository at this point in the history
…ation

validation: Reduce O(N**2) edge comparison to O(N)
  • Loading branch information
hjoliver committed Apr 7, 2016
2 parents 7a12d09 + 1367b30 commit 61803f5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/cylc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,11 +737,9 @@ def __init__(self, suite, fpath, template_vars=[], template_vars_file=None,
graph.acyclic()
# Look for reversed edges (note this does not detect
# self-edges).
n_edges = graph.edges()
back_edges = []
for e in o_edges:
if e not in n_edges:
back_edges.append(e)
n_edges = set(graph.edges())

back_edges = [x for x in o_edges if x not in n_edges]
if len(back_edges) > 0:
print >> sys.stderr, "Back-edges:"
for e in back_edges:
Expand Down

0 comments on commit 61803f5

Please sign in to comment.