mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 01:14:13 +08:00
mdbx: minor refine mdbx_page_search()
internals.
This commit is contained in:
parent
7ade182d64
commit
bfea3ca9fb
20
src/core.c
20
src/core.c
@ -13682,15 +13682,17 @@ __hot static int mdbx_page_search(MDBX_cursor *mc, const MDBX_val *key,
|
|||||||
pp_txnid = /* mc->mc_db->md_mod_txnid maybe zero in a legacy DB */ pp_txnid
|
pp_txnid = /* mc->mc_db->md_mod_txnid maybe zero in a legacy DB */ pp_txnid
|
||||||
? pp_txnid
|
? pp_txnid
|
||||||
: mc->mc_txn->mt_txnid;
|
: mc->mc_txn->mt_txnid;
|
||||||
MDBX_txn *scan = mc->mc_txn;
|
if ((mc->mc_txn->mt_flags & MDBX_TXN_RDONLY) == 0) {
|
||||||
do
|
MDBX_txn *scan = mc->mc_txn;
|
||||||
if ((scan->mt_flags & MDBX_TXN_DIRTY) &&
|
do
|
||||||
(mc->mc_dbi == MAIN_DBI ||
|
if ((scan->mt_flags & MDBX_TXN_DIRTY) &&
|
||||||
(scan->mt_dbistate[mc->mc_dbi] & DBI_DIRTY))) {
|
(mc->mc_dbi == MAIN_DBI ||
|
||||||
pp_txnid = scan->mt_front;
|
(scan->mt_dbistate[mc->mc_dbi] & DBI_DIRTY))) {
|
||||||
break;
|
pp_txnid = scan->mt_front;
|
||||||
}
|
break;
|
||||||
while (unlikely((scan = scan->mt_parent) != nullptr));
|
}
|
||||||
|
while (unlikely((scan = scan->mt_parent) != nullptr));
|
||||||
|
}
|
||||||
if (unlikely((rc = mdbx_page_get(mc, root, &mc->mc_pg[0], pp_txnid)) != 0))
|
if (unlikely((rc = mdbx_page_get(mc, root, &mc->mc_pg[0], pp_txnid)) != 0))
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user