Simplify MDB_MULTIPLE

incre
Hallvard Furuseth 11 years ago
parent ac158c7e1e
commit ba8f59edf4
  1. 9
      libraries/liblmdb/mdb.c

@ -5976,12 +5976,9 @@ more:
/* if data matches, skip it */ /* if data matches, skip it */
if (!mc->mc_dbx->md_dcmp(data, &olddata)) { if (!mc->mc_dbx->md_dcmp(data, &olddata)) {
if (flags & MDB_NODUPDATA) if (flags & MDB_NODUPDATA)
rc = MDB_KEYEXIST; return MDB_KEYEXIST;
else if (flags & MDB_MULTIPLE)
goto next_mult;
else
rc = MDB_SUCCESS; rc = MDB_SUCCESS;
return rc; goto next_sub;
} }
/* Back up original data item */ /* Back up original data item */
@ -6258,9 +6255,9 @@ put_sub:
*/ */
mc->mc_flags |= C_INITIALIZED; mc->mc_flags |= C_INITIALIZED;
} }
next_sub:
if (flags & MDB_MULTIPLE) { if (flags & MDB_MULTIPLE) {
if (!rc) { if (!rc) {
next_mult:
mcount++; mcount++;
/* let caller know how many succeeded, if any */ /* let caller know how many succeeded, if any */
data[1].mv_size = mcount; data[1].mv_size = mcount;

Loading…
Cancel
Save