aboutsummaryrefslogtreecommitdiff
path: root/cursor.go
diff options
context:
space:
mode:
Diffstat (limited to 'cursor.go')
-rw-r--r--cursor.go9
1 files changed, 7 insertions, 2 deletions
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]