Skip to content

Commit a8af23b

Browse files
authored
opt: reuse var leafPageElementSize (#215)
1 parent 6dc724c commit a8af23b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

page.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (p *page) meta() *meta {
5656

5757
// leafPageElement retrieves the leaf node by index
5858
func (p *page) leafPageElement(index uint16) *leafPageElement {
59-
off := uintptr(index) * unsafe.Sizeof(leafPageElement{})
59+
off := uintptr(index) * leafPageElementSize
6060
return (*leafPageElement)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + unsafe.Sizeof(*p) + off))
6161
}
6262

0 commit comments

Comments
 (0)