mdbx: minor simplify mdb_del0().

This commit is contained in:
Leo Yuriev 2017-01-30 22:12:47 +03:00
parent 61e1efeb85
commit 7bf9d381ee

7
mdb.c
View File

@ -8779,7 +8779,7 @@ mdb_del0(MDB_txn *txn, MDB_dbi dbi,
MDB_cursor mc; MDB_cursor mc;
MDB_xcursor mx; MDB_xcursor mx;
MDB_cursor_op op; MDB_cursor_op op;
MDB_val rdata, *xdata; MDB_val rdata;
int rc, exact = 0; int rc, exact = 0;
DKBUF; DKBUF;
@ -8790,13 +8790,12 @@ mdb_del0(MDB_txn *txn, MDB_dbi dbi,
if (data) { if (data) {
op = MDB_GET_BOTH; op = MDB_GET_BOTH;
rdata = *data; rdata = *data;
xdata = &rdata; data = &rdata;
} else { } else {
op = MDB_SET; op = MDB_SET;
xdata = NULL;
flags |= MDB_NODUPDATA; flags |= MDB_NODUPDATA;
} }
rc = mdb_cursor_set(&mc, key, xdata, op, &exact); rc = mdb_cursor_set(&mc, key, data, op, &exact);
if (likely(rc == 0)) { if (likely(rc == 0)) {
/* let mdb_page_split know about this cursor if needed: /* let mdb_page_split know about this cursor if needed:
* delete will trigger a rebalance; if it needs to move * delete will trigger a rebalance; if it needs to move