From 3c87e0271625ea74e6dac94bc3182cf35ffefb2a Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Sun, 26 Aug 2018 18:49:14 +0300 Subject: [PATCH] mdbx: add `unlikely` for comparison result inside mdbx_cursor_set(). --- src/mdbx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mdbx.c b/src/mdbx.c index 18434939..88bbcbd3 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -7154,10 +7154,9 @@ static int mdbx_cursor_set(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data, MDBX_GET_KEY2(leaf, nodekey); } rc = mc->mc_dbx->md_cmp(key, &nodekey); - if (rc == 0) { + if (unlikely(rc == 0)) { /* Probably happens rarely, but first node on the page - * was the one we wanted. - */ + * was the one we wanted. */ mc->mc_ki[mc->mc_top] = 0; if (exactp) *exactp = 1;