Skip to content

Commit

Permalink
opt: reuse var leafPageElementSize (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
chyroc committed Apr 24, 2020
1 parent 6dc724c commit a8af23b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion page.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (p *page) meta() *meta {

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

Expand Down

0 comments on commit a8af23b

Please sign in to comment.