diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-27 22:22:37 -0500 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-27 22:22:37 -0500 |
commit | ef590ecdfb8880dda7d844165924b35f5dd758ab (patch) | |
tree | da08883acddab7e71136f8baa28810be0081ff89 /cursor.go | |
parent | Intermediate. (diff) | |
download | dedo-ef590ecdfb8880dda7d844165924b35f5dd758ab.tar.gz dedo-ef590ecdfb8880dda7d844165924b35f5dd758ab.tar.xz |
lpage
Diffstat (limited to 'cursor.go')
-rw-r--r-- | cursor.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -45,12 +45,17 @@ func (c *Cursor) Goto(key []byte) bool { return false } -// current the page and leaf node that the cursor is currently pointing at. -func (c *Cursor) current() (*page, *lnode) { +// top returns the page and leaf node that the cursor is currently pointing at. +func (c *Cursor) top() (*page, *lnode) { elem := c.stack[len(c.stack)-1] return elem.page, elem.page.lnode(elem.index) } +// page returns the page that the cursor is currently pointing at. +func (c *Cursor) page() *page { + return c.stack[len(c.stack)-1].page +} + // node returns the leaf node that the cursor is currently positioned on. func (c *Cursor) node() *lnode { elem := c.stack[len(c.stack)-1] |