aboutsummaryrefslogtreecommitdiff
path: root/bucket.go
diff options
context:
space:
mode:
authorMartin Kobetic <mkobetic@gmail.com>2014-05-12 19:33:53 +0000
committerMartin Kobetic <mkobetic@gmail.com>2014-05-12 19:33:53 +0000
commit0716cdaec8e4a0d12085cda61d58ae275028670b (patch)
tree0476c09a2ebd78f8412b69c7d727989c4acaf4e0 /bucket.go
parentmerge inline branch into leaf branch (diff)
downloaddedo-0716cdaec8e4a0d12085cda61d58ae275028670b.tar.gz
dedo-0716cdaec8e4a0d12085cda61d58ae275028670b.tar.xz
tweaks
Diffstat (limited to 'bucket.go')
-rw-r--r--bucket.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/bucket.go b/bucket.go
index fdc9852..4d45b38 100644
--- a/bucket.go
+++ b/bucket.go
@@ -371,8 +371,9 @@ func (b *Bucket) Stats() BucketStats {
b.forEachPage(func(p *page, depth int) {
if (p.flags & leafPageFlag) != 0 {
s.KeyN += int(p.count)
- used := pageHeaderSize + (leafPageElementSize * int(p.count))
+ used := pageHeaderSize
if p.count != 0 {
+ used += leafPageElementSize * int(p.count-1)
lastElement := p.leafPageElement(p.count - 1)
used += int(lastElement.pos + lastElement.ksize + lastElement.vsize)
}