From 7d1eff5116d5bcdb59c53f65267203ab3ccec3a7 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Fri, 27 Dec 2019 15:01:15 +0300 Subject: [PATCH] mdbx: minor refine cursor_put(). Use `rc2` variable to simplify register(s) allocation. Change-Id: Ie47210a4b494e9aeaa8492830cfbcbbde02b485c --- src/elements/core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/elements/core.c b/src/elements/core.c index 0f96fac6..48eb13bb 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -11011,9 +11011,9 @@ int mdbx_cursor_put(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data, /* LY: add configurable threshold to keep reserve space */ dpages) { if (!IS_DIRTY(omp) && (level || (env->me_flags & MDBX_WRITEMAP))) { - rc = mdbx_page_unspill(mc->mc_txn, omp, &omp); - if (unlikely(rc)) - return rc; + rc2 = mdbx_page_unspill(mc->mc_txn, omp, &omp); + if (unlikely(rc2)) + return rc2; level = 0; /* dirty in this txn or clean */ } /* Is it dirty? */ @@ -11180,8 +11180,8 @@ int mdbx_cursor_put(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data, nested_dupdb.md_entries = page_numkeys(fp); xdata.iov_len = sizeof(nested_dupdb); xdata.iov_base = &nested_dupdb; - if ((rc = mdbx_page_alloc(mc, 1, &mp, MDBX_ALLOC_ALL))) - return rc; + if ((rc2 = mdbx_page_alloc(mc, 1, &mp, MDBX_ALLOC_ALL))) + return rc2; mc->mc_db->md_leaf_pages += 1; mdbx_cassert(mc, env->me_psize > olddata.iov_len); offset = env->me_psize - (unsigned)olddata.iov_len;