diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-03-08 19:45:56 -0800 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-03-08 19:45:56 -0800 |
commit | 4e252b8a7f3df03ff8a079de1e3d7c64f0fcde6d (patch) | |
tree | 93ac43914f9cd20c8eea13f18105e55026a7ea8d /bucket.go | |
parent | Merge pull request #60 from benbjohnson/tx (diff) | |
parent | Consolidate Tx and RWTx. (diff) | |
download | dedo-4e252b8a7f3df03ff8a079de1e3d7c64f0fcde6d.tar.gz dedo-4e252b8a7f3df03ff8a079de1e3d7c64f0fcde6d.tar.xz |
Merge pull request #61 from benbjohnson/merge-tx
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 } |