mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 19:44:13 +08:00
mdbx: minor refine cursor_put().
Use `rc2` variable to simplify register(s) allocation. Change-Id: Ie47210a4b494e9aeaa8492830cfbcbbde02b485c
This commit is contained in:
parent
36c7d7a435
commit
7d1eff5116
@ -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 */
|
/* LY: add configurable threshold to keep reserve space */
|
||||||
dpages) {
|
dpages) {
|
||||||
if (!IS_DIRTY(omp) && (level || (env->me_flags & MDBX_WRITEMAP))) {
|
if (!IS_DIRTY(omp) && (level || (env->me_flags & MDBX_WRITEMAP))) {
|
||||||
rc = mdbx_page_unspill(mc->mc_txn, omp, &omp);
|
rc2 = mdbx_page_unspill(mc->mc_txn, omp, &omp);
|
||||||
if (unlikely(rc))
|
if (unlikely(rc2))
|
||||||
return rc;
|
return rc2;
|
||||||
level = 0; /* dirty in this txn or clean */
|
level = 0; /* dirty in this txn or clean */
|
||||||
}
|
}
|
||||||
/* Is it dirty? */
|
/* 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);
|
nested_dupdb.md_entries = page_numkeys(fp);
|
||||||
xdata.iov_len = sizeof(nested_dupdb);
|
xdata.iov_len = sizeof(nested_dupdb);
|
||||||
xdata.iov_base = &nested_dupdb;
|
xdata.iov_base = &nested_dupdb;
|
||||||
if ((rc = mdbx_page_alloc(mc, 1, &mp, MDBX_ALLOC_ALL)))
|
if ((rc2 = mdbx_page_alloc(mc, 1, &mp, MDBX_ALLOC_ALL)))
|
||||||
return rc;
|
return rc2;
|
||||||
mc->mc_db->md_leaf_pages += 1;
|
mc->mc_db->md_leaf_pages += 1;
|
||||||
mdbx_cassert(mc, env->me_psize > olddata.iov_len);
|
mdbx_cassert(mc, env->me_psize > olddata.iov_len);
|
||||||
offset = env->me_psize - (unsigned)olddata.iov_len;
|
offset = env->me_psize - (unsigned)olddata.iov_len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user