Skip to content

Commit

Permalink
removed not needed cursor_get funcs (#153)
Browse files Browse the repository at this point in the history
Co-authored-by: JkLondon <[email protected]>
  • Loading branch information
JkLondon and JkLondon authored Jul 28, 2024
1 parent c531783 commit f71fbcb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion mdbx/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
12 changes: 1 addition & 11 deletions mdbx/mdbxgo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions mdbx/mdbxgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f71fbcb

Please sign in to comment.