diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-03-08 20:25:37 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-03-08 20:40:48 -0700 |
commit | c551e45a4722f58dc4c19f9d1b80b0b8db3ad039 (patch) | |
tree | 93ac43914f9cd20c8eea13f18105e55026a7ea8d /bucket.go | |
parent | Rename Transaction to Tx. (diff) | |
download | dedo-c551e45a4722f58dc4c19f9d1b80b0b8db3ad039.tar.gz dedo-c551e45a4722f58dc4c19f9d1b80b0b8db3ad039.tar.xz |
Consolidate Tx and RWTx.
Diffstat (limited to 'bucket.go')
-rw-r--r-- | bucket.go | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 } |