From f71fbcbc687ff1faae882bed30dfe674debdd65b Mon Sep 17 00:00:00 2001 From: Ilya Mikheev <54912776+JkLondon@users.noreply.github.com> Date: Sun, 28 Jul 2024 07:40:58 +0300 Subject: [PATCH] removed not needed cursor_get funcs (#153) Co-authored-by: JkLondon --- mdbx/cursor.go | 2 +- mdbx/mdbxgo.c | 12 +----------- mdbx/mdbxgo.h | 4 +--- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/mdbx/cursor.go b/mdbx/cursor.go index 2fb29f1..4f1a45b 100644 --- a/mdbx/cursor.go +++ b/mdbx/cursor.go @@ -198,7 +198,7 @@ func (c *Cursor) getVal(setkey, setval []byte, op uint) error { if len(setval) > 0 { v = (*C.char)(unsafe.Pointer(&setval[0])) } - ret := C.mdbxgo_cursor_get2( + ret := C.mdbxgo_cursor_get( c._c, k, C.size_t(len(setkey)), v, C.size_t(len(setval)), diff --git a/mdbx/mdbxgo.c b/mdbx/mdbxgo.c index 5ba68a8..45560e8 100644 --- a/mdbx/mdbxgo.c +++ b/mdbx/mdbxgo.c @@ -75,17 +75,7 @@ int mdbxgo_cursor_putmulti(MDBX_cursor *cur, char *kdata, size_t kn, char *vdata return mdbx_cursor_put(cur, &key, &val[0], flags); } -int mdbxgo_cursor_get01(MDBX_cursor *cur, char *vdata, size_t vn, MDBX_val *key, MDBX_val *val, MDBX_cursor_op op) { - MDBXGO_SET_VAL(val, vn, vdata); - return mdbx_cursor_get(cur, key, val, op); -} - -int mdbxgo_cursor_get1(MDBX_cursor *cur, char *kdata, size_t kn, MDBX_val *key, MDBX_val *val, MDBX_cursor_op op) { - MDBXGO_SET_VAL(key, kn, kdata); - return mdbx_cursor_get(cur, key, val, op); -} - -int mdbxgo_cursor_get2(MDBX_cursor *cur, char *kdata, size_t kn, char *vdata, size_t vn, MDBX_val *key, MDBX_val *val, MDBX_cursor_op op) { +int mdbxgo_cursor_get(MDBX_cursor *cur, char *kdata, size_t kn, char *vdata, size_t vn, MDBX_val *key, MDBX_val *val, MDBX_cursor_op op) { MDBXGO_SET_VAL(key, kn, kdata); MDBXGO_SET_VAL(val, vn, vdata); return mdbx_cursor_get(cur, key, val, op); diff --git a/mdbx/mdbxgo.h b/mdbx/mdbxgo.h index 9b1ed64..ac94749 100644 --- a/mdbx/mdbxgo.h +++ b/mdbx/mdbxgo.h @@ -24,9 +24,7 @@ int mdbxgo_put2(MDBX_txn *txn, MDBX_dbi dbi, char *kdata, size_t kn, char *vdata int mdbxgo_cursor_put1(MDBX_cursor *cur, char *kdata, size_t kn, MDBX_val *val, MDBX_put_flags_t flags); int mdbxgo_cursor_put2(MDBX_cursor *cur, char *kdata, size_t kn, char *vdata, size_t vn, MDBX_put_flags_t flags); int mdbxgo_cursor_putmulti(MDBX_cursor *cur, char *kdata, size_t kn, char *vdata, size_t vn, size_t vstride, MDBX_put_flags_t flags); -int mdbxgo_cursor_get01(MDBX_cursor *cur, char *vdata, size_t vn, MDBX_val *key, MDBX_val *val, MDBX_cursor_op op); -int mdbxgo_cursor_get1(MDBX_cursor *cur, char *kdata, size_t kn, MDBX_val *key, MDBX_val *val, MDBX_cursor_op op); -int mdbxgo_cursor_get2(MDBX_cursor *cur, char *kdata, size_t kn, char *vdata, size_t vn, MDBX_val *key, MDBX_val *val, MDBX_cursor_op op); +int mdbxgo_cursor_get(MDBX_cursor *cur, char *kdata, size_t kn, char *vdata, size_t vn, MDBX_val *key, MDBX_val *val, MDBX_cursor_op op); /* ConstCString wraps a null-terminated (const char *) because Go's type system * does not represent the 'cosnt' qualifier directly on a function argument and * causes warnings to be emitted during linking.