Skip to content
Snippets Groups Projects
Commit 8fd686ad authored by Howard Chu's avatar Howard Chu
Browse files

Restore avl_find code independent of avl_find2

parent b674e6dd
Branches
Tags
No related merge requests found
......@@ -661,7 +661,14 @@ avl_find2( Avlnode *root, const void *data, AVL_CMP fcmp )
void*
avl_find( Avlnode *root, const void* data, AVL_CMP fcmp )
{
root = avl_find2( root, data, fcmp );
int cmp;
while ( root != 0 && (cmp = (*fcmp)( data, root->avl_data )) != 0 ) {
if ( cmp < 0 )
root = root->avl_left;
else
root = root->avl_right;
}
return( root ? root->avl_data : 0 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment