From c551e45a4722f58dc4c19f9d1b80b0b8db3ad039 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sat, 8 Mar 2014 20:25:37 -0700 Subject: Consolidate Tx and RWTx. --- bucket.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bucket.go') diff --git a/bucket.go b/bucket.go index e406a6e..e1ad2a3 100644 --- a/bucket.go +++ b/bucket.go @@ -9,7 +9,6 @@ type Bucket struct { *bucket name string tx *Tx - rwtx *RWTx } // bucket represents the on-file representation of a bucket. @@ -25,7 +24,7 @@ func (b *Bucket) Name() string { // Writable returns whether the bucket is writable. func (b *Bucket) Writable() bool { - return (b.rwtx != nil) + return b.tx.writable } // Cursor creates a cursor associated with the bucket. @@ -74,7 +73,7 @@ func (b *Bucket) Put(key []byte, value []byte) error { c.Seek(key) // Insert the key/value. - c.node(b.rwtx).put(key, key, value, 0) + c.node(b.tx).put(key, key, value, 0) return nil } @@ -92,7 +91,7 @@ func (b *Bucket) Delete(key []byte) error { c.Seek(key) // Delete the node if we have a matching key. - c.node(b.rwtx).del(key) + c.node(b.tx).del(key) return nil } -- cgit v1.2.3