From 317816d6c72a706d5dda1b87a9a288508b8281c1 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 29 Aug 2020 01:59:43 +0300 Subject: [PATCH] mdbx: refine/simplify mdbx_cursor_del(). Change-Id: Ibd72817a33427483a4440eecc911815420b2e13f --- src/core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core.c b/src/core.c index 8ce829d2..f1d18895 100644 --- a/src/core.c +++ b/src/core.c @@ -12886,7 +12886,7 @@ int mdbx_cursor_del(MDBX_cursor *mc, MDBX_put_flags_t flags) { return rc; if (unlikely(!(mc->mc_flags & C_INITIALIZED))) - return MDBX_EINVAL; + return MDBX_ENODATA; if (unlikely(mc->mc_ki[mc->mc_top] >= page_numkeys(mc->mc_pg[mc->mc_top]))) return MDBX_NOTFOUND; @@ -12965,10 +12965,8 @@ int mdbx_cursor_del(MDBX_cursor *mc, MDBX_put_flags_t flags) { } } /* MDBX passes F_SUBDATA in 'flags' to delete a DB record */ - else if (unlikely((node_flags(node) ^ flags) & F_SUBDATA)) { - rc = MDBX_INCOMPATIBLE; - goto fail; - } + else if (unlikely((node_flags(node) ^ flags) & F_SUBDATA)) + return MDBX_INCOMPATIBLE; /* add overflow pages to free list */ if (F_ISSET(node_flags(node), F_BIGDATA)) {