Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
mdbx: more unlikely().
Browse files Browse the repository at this point in the history
  • Loading branch information
erthink committed Dec 2, 2021
1 parent d96bc98 commit d2b15b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -13741,14 +13741,14 @@ static int mdbx_cursor_next(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
MDBX_node *node;
int rc;

if ((mc->mc_flags & C_DEL) && op == MDBX_NEXT_DUP)
if (unlikely(mc->mc_flags & C_DEL) && op == MDBX_NEXT_DUP)
return MDBX_NOTFOUND;

if (!(mc->mc_flags & C_INITIALIZED))
if (unlikely(!(mc->mc_flags & C_INITIALIZED)))
return mdbx_cursor_first(mc, key, data);

mp = mc->mc_pg[mc->mc_top];
if (mc->mc_flags & C_EOF) {
if (unlikely(mc->mc_flags & C_EOF)) {
if (mc->mc_ki[mc->mc_top] + 1u >= page_numkeys(mp))
return (mc->mc_flags & C_SUB) ? MDBX_NOTFOUND : MDBX_ENODATA;
mc->mc_flags ^= C_EOF;
Expand Down Expand Up @@ -13842,10 +13842,10 @@ static int mdbx_cursor_prev(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
MDBX_node *node;
int rc;

if ((mc->mc_flags & C_DEL) && op == MDBX_PREV_DUP)
if (unlikely(mc->mc_flags & C_DEL) && op == MDBX_PREV_DUP)
return MDBX_NOTFOUND;

if (!(mc->mc_flags & C_INITIALIZED)) {
if (unlikely(!(mc->mc_flags & C_INITIALIZED))) {
rc = mdbx_cursor_last(mc, key, data);
if (unlikely(rc))
return rc;
Expand Down

0 comments on commit d2b15b5

Please sign in to comment.