diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2016-03-25 21:17:42 -0600 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2016-03-25 21:17:42 -0600 |
commit | b35bb5db2e0ef64e0d987504a4cd3d14224e8aa4 (patch) | |
tree | da55ceb25e0642f44187e1ce5350054b570431be /page.go | |
parent | Merge pull request #542 from boltdb/remove-drone-badge (diff) | |
parent | set slice capacity (diff) | |
download | dedo-b35bb5db2e0ef64e0d987504a4cd3d14224e8aa4.tar.gz dedo-b35bb5db2e0ef64e0d987504a4cd3d14224e8aa4.tar.xz |
Merge pull request #545 from benbjohnson/slice-capacity
Set slice capacity
Diffstat (limited to 'page.go')
-rw-r--r-- | page.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -111,13 +111,13 @@ type leafPageElement struct { // key returns a byte slice of the node key. func (n *leafPageElement) key() []byte { buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) - return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos]))[:n.ksize] + return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos]))[:n.ksize:n.ksize] } // value returns a byte slice of the node value. func (n *leafPageElement) value() []byte { buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) - return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos+n.ksize]))[:n.vsize] + return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos+n.ksize]))[:n.vsize:n.vsize] } // PageInfo represents human readable information about a page. |