From ef590ecdfb8880dda7d844165924b35f5dd758ab Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 27 Jan 2014 22:22:37 -0500 Subject: lpage --- cursor.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cursor.go') diff --git a/cursor.go b/cursor.go index 2f75677..e6b2c31 100644 --- a/cursor.go +++ b/cursor.go @@ -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] -- cgit v1.2.3