mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-30 11:29:19 +08:00
mdbx: fix mdbx_node_search().
This commit is contained in:
parent
daa08e6102
commit
3d08b9e76f
10
mdbx.c
10
mdbx.c
@ -5558,11 +5558,9 @@ static MDB_node *__hot mdbx_node_search(MDB_cursor *mc, MDB_val *key,
|
||||
}
|
||||
}
|
||||
|
||||
if (rc > 0) { /* Found entry is less than the key. */
|
||||
i++; /* Skip to get the smallest entry larger than key. */
|
||||
if (!IS_LEAF2(mp))
|
||||
node = NODEPTR(mp, i);
|
||||
}
|
||||
if (rc > 0) /* Found entry is less than the key. */
|
||||
i++; /* Skip to get the smallest entry larger than key. */
|
||||
|
||||
if (exactp)
|
||||
*exactp = (rc == 0 && nkeys > 0);
|
||||
/* store the key index */
|
||||
@ -5572,7 +5570,7 @@ static MDB_node *__hot mdbx_node_search(MDB_cursor *mc, MDB_val *key,
|
||||
return NULL;
|
||||
|
||||
/* nodeptr is fake for LEAF2 */
|
||||
return node;
|
||||
return IS_LEAF2(mp) ? node : NODEPTR(mp, i);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user