it seems that the entire block of code
|
uint yParent = self.nodes[cursor].parent; |
|
self.nodes[probe].parent = yParent; |
|
if (yParent != EMPTY) { |
|
if (cursor == self.nodes[yParent].left) { |
|
self.nodes[yParent].left = probe; |
|
} else { |
|
self.nodes[yParent].right = probe; |
|
} |
|
} else { |
|
self.root = probe; |
|
} |
could be replaced by the the single call
replaceParent(probe, cursor), with identical semantics. am i missing something?
it seems that the entire block of code
BokkyPooBahsRedBlackTreeLibrary/contracts/BokkyPooBahsRedBlackTreeLibrary.sol
Lines 126 to 136 in a8e9864
replaceParent(probe, cursor), with identical semantics. am i missing something?