Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@recp
Copy link
Owner

@recp recp commented Dec 5, 2020

New functions:

void*   rb_find_by(RBTree * __restrict tree, void * __restrict key, const DsCmpFn cmp);
RBNode* rb_find_node_by(RBTree * __restrict tree, void * __restrict key, const DsCmpFn cmp);

Custom compare can be used for getting items. For instance you can compare null terminated string with non-null terminated string by providing custom compare to rb_find_by().

  • previous rb_find() and rb_find_node() now uses rb_find_node_by() to reduce pointer dereferencing (hope there will no bugs here)

recp added 2 commits December 5, 2020 13:28
in this way, custom compare can be used for getting items. For instance you can compare null terminated string with non-null terminated string by providing custom compare to find()
@recp recp merged commit ad33882 into master Dec 8, 2020
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.

1 participant