Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed not needed cursor_get funcs #153

Merged
merged 1 commit into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading