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

Method __getlink

recipes/Python/577898_23_Tree/recipe-577898.py:77–84  ·  view source on GitHub ↗
(self, a)

Source from the content-addressed store, hash-verified

75 yield item
76
77 def __getlink(self, a):
78 for idx in xrange(self.valcnt):
79 if idx is 0:
80 if a < self.values[idx]: return idx
81 else:
82 if self.values[idx - 1] < a < self.values[idx]: return idx
83 if idx == self.valcnt - 1: return idx + 1
84 return -1
85
86 def __addLink(self, link):
87 if self.links is None: self.links = [None] * 4

Callers 2

addLinkMethod · 0.95
chooseChildMethod · 0.95

Calls 1

xrangeClass · 0.85

Tested by

no test coverage detected