Skip to content

block of redundant code #15

Description

@firnprotocol

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions