summaryrefslogtreecommitdiff
path: root/monkey/graph.py
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-08-24 15:32:06 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-08-24 15:32:06 +0200
commit5b4f1e25980ee18a323eba1415ed453b3a910ca3 (patch)
treec0de7236bd56478a46c175184a21099cf706dc1f /monkey/graph.py
parent367d955d6e28ccb64ccd6dc21c009c8fac6ffe4b (diff)
Remove in-edges from monkey.graph.Node class
Diffstat (limited to 'monkey/graph.py')
-rw-r--r--monkey/graph.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/monkey/graph.py b/monkey/graph.py
index a8ad4b0..c69d55c 100644
--- a/monkey/graph.py
+++ b/monkey/graph.py
@@ -3,21 +3,13 @@
class Node(object):
def __init__(self, data, eout=None):
self.data = data
- self.ein = []
self.eout = eout if eout else []
- # (Re-)insert a child node [target] to [self] at index [idx] (or as the
- # rightmost child if index is not given). Also append [self] to the list of
- # parents of [target].
+ # (Re-)insert [target] as the right-most child of [self].
def add_out(self, target, idx=None):
if target in self.eout:
self.eout.remove(target)
- if idx is None:
- self.eout.append(target)
- else:
- self.eout.insert(idx, target)
- if self not in target.ein:
- target.ein.append(self)
+ self.eout.append(target)
return target
# Return a list of nodes in [self].