mdbx: simplify page_unspill().

Change-Id: Iaa182d1feaf2abb59015725f000a3d9e0c57de8d
This commit is contained in:
Leonid Yuriev 2021-04-17 19:20:47 +03:00
parent 3622433cf4
commit 6d3ff10165

View File

@ -6398,10 +6398,7 @@ static int __must_check_result mdbx_page_unspill(MDBX_txn *const txn,
MDBX_page *np = mdbx_page_malloc(txn, npages);
if (unlikely(!np))
return MDBX_ENOMEM;
if (likely(npages == 1))
mdbx_page_copy(np, mp, txn->mt_env->me_psize);
else
memcpy(np, mp, pgno2bytes(txn->mt_env, npages));
mdbx_page_copy(np, mp, pgno2bytes(txn->mt_env, npages));
mdbx_debug("unspill page %" PRIaPGNO, mp->mp_pgno);
if (scan == txn) {
/* If in current txn, this page is no longer spilled.