mdbx: add unlikely for comparison result inside mdbx_cursor_set().

This commit is contained in:
Leo Yuriev 2018-08-26 18:49:14 +03:00
parent 51b89c9690
commit 3c87e02716

View File

@ -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;