MCPcopy Create free account
hub / github.com/ActiveState/code / __insertLink

Method __insertLink

recipes/Python/577898_23_Tree/recipe-577898.py:91–101  ·  view source on GitHub ↗
(self, idx, anotherNode)

Source from the content-addressed store, hash-verified

89 self.refcnt += 1
90
91 def __insertLink(self, idx, anotherNode):
92 if self.links is None: self.links = [None] * 4
93 if idx == 0:
94 self.links[0],self.links[1],self.links[2], self.links[3] = anotherNode,self.links[0],self.links[1], self.links[2]
95 elif idx == 1:
96 self.links[1], self.links[2], self.links[3] = anotherNode, self.links[1], self.links[2]
97 elif idx == 2:
98 self.links[2], self.links[3] = anotherNode, self.links[2]
99 else:
100 self.links[3] = anotherNode
101 self.refcnt += 1
102
103 def __removeLink(self, idx):
104 if idx == 0:

Callers 2

__rearrangeLinksMethod · 0.95
addLinkMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected