From 6d3ff10165abc1ac270797600be5fe72985439ed Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 17 Apr 2021 19:20:47 +0300 Subject: [PATCH] mdbx: simplify `page_unspill()`. Change-Id: Iaa182d1feaf2abb59015725f000a3d9e0c57de8d --- src/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core.c b/src/core.c index 1690e0f6..671ad3e7 100644 --- a/src/core.c +++ b/src/core.c @@ -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.