Commit e55383ea authored by Bram Schoenmakers's avatar Bram Schoenmakers

Shortening the edge_id lookup method.

parent ce9d5c30
...@@ -125,14 +125,8 @@ class DirectedGraph(object): ...@@ -125,14 +125,8 @@ class DirectedGraph(object):
""" """
Returns True if the client registered an edge with the given id. Returns True if the client registered an edge with the given id.
""" """
result = False l = [e for e in self._edge_numbers.itervalues() if e == p_id]
return len(l) > 0
for edge_id in self._edge_numbers.itervalues():
if edge_id == p_id:
result = True
break
return result
def edge_id(self, p_from, p_to): def edge_id(self, p_from, p_to):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment