diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-30 00:11:46 -0500 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-30 00:11:46 -0500 |
commit | 149d48fb9e3e8147cf0bce84a4e11164ac9cdbf3 (patch) | |
tree | 2616c762651a8e516e348c3741d502a1f68ffd16 /bucket.go | |
parent | Add freelist page type. (diff) | |
download | dedo-149d48fb9e3e8147cf0bce84a4e11164ac9cdbf3.tar.gz dedo-149d48fb9e3e8147cf0bce84a4e11164ac9cdbf3.tar.xz |
Fix leaf/branch deserialization.
Diffstat (limited to 'bucket.go')
-rw-r--r-- | bucket.go | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -4,29 +4,27 @@ type Bucket struct { *bucket name string transaction *Transaction - cursors []*Cursor } type bucket struct { root pgid } +// Name returns the name of the bucket. +func (b *Bucket) Name() string { + return b.name +} + // Get retrieves the value for a key in the bucket. func (b *Bucket) Get(key []byte) []byte { - return b.cursor().Get(key) + return b.Cursor().Get(key) } // Cursor creates a new cursor for this bucket. func (b *Bucket) Cursor() *Cursor { - c := b.cursor() - b.cursors = append(b.cursors, c) - return c -} - -// cursor creates a new untracked cursor for this bucket. -func (b *Bucket) cursor() *Cursor { return &Cursor{ - bucket: b, + transaction: b.transaction, + root: b.root, stack: make([]elem, 0), } } |