LeafPageElements retrieves a list of leaf nodes.
()
| 105 | |
| 106 | // LeafPageElements retrieves a list of leaf nodes. |
| 107 | func (p *Page) LeafPageElements() []leafPageElement { |
| 108 | if p.count == 0 { |
| 109 | return nil |
| 110 | } |
| 111 | data := UnsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p)) |
| 112 | elems := unsafe.Slice((*leafPageElement)(data), int(p.count)) |
| 113 | return elems |
| 114 | } |
| 115 | |
| 116 | // BranchPageElement retrieves the branch node by index |
| 117 | func (p *Page) BranchPageElement(index uint16) *branchPageElement { |