Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1 from NebulousLabs/holes
Browse files Browse the repository at this point in the history
Patch holes
  • Loading branch information
lukechampine committed Oct 28, 2015
2 parents 8488501 + ddef166 commit 8233989
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,6 @@ func (b *Bucket) Delete(key []byte) error {
// Delete the node if we have a matching key.
c.node().del(key)

// Rebalance the bucket.
b.rebalance()

return nil
}

Expand Down
8 changes: 8 additions & 0 deletions cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func (c *Cursor) First() (key []byte, value []byte) {
if (flags & uint32(bucketLeafFlag)) != 0 {
return k, nil
}
if k == nil && v == nil && flags == 0 {
k, v, flags = c.next()
}
return k, v

}
Expand Down Expand Up @@ -230,6 +233,11 @@ func (c *Cursor) next() (key []byte, value []byte, flags uint32) {
// first element of the first leaf page.
c.stack = c.stack[:i+1]
c.first()

if c.stack[len(c.stack)-1].count() == 0 {
return c.next()
}

return c.keyValue()
}

Expand Down

0 comments on commit 8233989

Please sign in to comment.