mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-10 00:45:01 -05:00
Restore avl_find code independent of avl_find2
This commit is contained in:
parent
b674e6dd3d
commit
8fd686ada0
1 changed files with 8 additions and 1 deletions
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue