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

Lower branches in red-black tree #58

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Conversation

steven1lung
Copy link
Collaborator

The changes in this commit are aiming to remove if statements to achieve better performance by producing less branches.

Indirect pointers are used to store the pointer pointing to the left or right child node. So we would not need to check whether it is a right or left node.

src/map.c Show resolved Hide resolved
@jserv jserv self-requested a review September 26, 2022 17:22
@jserv jserv changed the title Apply branch-less for map.c Lower branches in red-black tree Sep 26, 2022
The changes in this commit are aiming to remove if statements
to achieve better performance by producing less branches.

Indirect pointers are used to store the pointer pointing to the
left or right child node. So we would not need to check whether it
is a right or left node.
@steven1lung
Copy link
Collaborator Author

steven1lung commented Sep 27, 2022

Code updated, please check.

@jserv jserv merged commit ff46dad into sysprog21:master Sep 27, 2022
@jserv
Copy link
Contributor

jserv commented Sep 27, 2022

Thank @steven1lung for contributing!

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

Successfully merging this pull request may close these issues.

2 participants