mirror of https://github.com/etcd-io/bbolt.git
opt: reuse var leafPageElementSize (#215)
parent
6dc724cf03
commit
a8af23b57f
2
page.go
2
page.go
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue