Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block of redundant code #15

Open
firnprotocol opened this issue Jul 29, 2023 · 0 comments
Open

block of redundant code #15

firnprotocol opened this issue Jul 29, 2023 · 0 comments

Comments

@firnprotocol
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant