aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dedo.go10
-rw-r--r--tests/dedo.go27
2 files changed, 1 insertions, 36 deletions
diff --git a/src/dedo.go b/src/dedo.go
index 12fdad6..4c56d4d 100644
--- a/src/dedo.go
+++ b/src/dedo.go
@@ -1118,11 +1118,6 @@ func cloneBytes(v []byte) []byte {
return clone
}
-/// Cursor.Bucket() returns the bucket that this cursor was created from.
-func (c *Cursor) Bucket() *Bucket {
- return c.bucket
-}
-
/// Cursor.First() moves the cursor to the first item in the bucket and returns
/// its key and value. If the bucket is empty then a nil key and value are
/// returned. The returned key and value are only valid for the life of the
@@ -3330,11 +3325,6 @@ func (tx *Tx) ID() int {
return int(tx.meta.txid)
}
-/// Tx.DB() returns a reference to the database that created the transaction.
-func (tx *Tx) DB() *DB {
- return tx.db
-}
-
/// Tx.Size() returns current database size in bytes as seen by this
/// transaction.
func (tx *Tx) Size() int64 {
diff --git a/tests/dedo.go b/tests/dedo.go
index 0506aa2..441d4ec 100644
--- a/tests/dedo.go
+++ b/tests/dedo.go
@@ -1862,30 +1862,6 @@ func ExampleBucket_ForEach() {
// A liger is awesome.
}
-// Ensure that a cursor can return a reference to the bucket that created it.
-func TestCursor_Bucket(t *testing.T) {
- db := MustOpenDB()
- defer db.MustClose()
- defer os.Remove(db.Path())
-
- err := db.Update(func(tx *Tx) error {
- b, err := tx.CreateBucket([]byte("widgets"))
- if err != nil {
- t.Fatal(err)
- }
-
- cb := b.Cursor().Bucket()
- if !reflect.DeepEqual(cb, b) {
- t.Fatal("cursor bucket mismatch")
- }
-
- return nil
- })
- if err != nil {
- t.Fatal(err)
- }
-}
-
// Ensure that a Tx cursor can seek to the appropriate keys.
func TestCursor_Seek(t *testing.T) {
db := MustOpenDB()
@@ -3262,7 +3238,7 @@ func TestDB_BeginRW(t *testing.T) {
t.Fatal("expected tx")
}
- if tx.DB() != db.DB {
+ if tx.db != db.DB {
t.Fatal("unexpected tx database")
} else if !tx.writable {
t.Fatal("expected writable tx")
@@ -6416,7 +6392,6 @@ func MainTest() {
// { "TestBucket_Put_Single", TestBucket_Put_Single },
// { "TestBucket_Put_Multiple", TestBucket_Put_Multiple },
// { "TestBucket_Delete_Quick", TestBucket_Delete_Quick },
- { "TestCursor_Bucket", TestCursor_Bucket },
{ "TestCursor_Seek", TestCursor_Seek },
{ "TestCursor_Delete", TestCursor_Delete },
{ "TestCursor_Seek_Large", TestCursor_Seek_Large },