aboutsummaryrefslogtreecommitdiff
path: root/cursor.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-01-27 22:22:37 -0500
committerBen Johnson <benbjohnson@yahoo.com>2014-01-27 22:22:37 -0500
commitef590ecdfb8880dda7d844165924b35f5dd758ab (patch)
treeda08883acddab7e71136f8baa28810be0081ff89 /cursor.go
parentIntermediate. (diff)
downloaddedo-ef590ecdfb8880dda7d844165924b35f5dd758ab.tar.gz
dedo-ef590ecdfb8880dda7d844165924b35f5dd758ab.tar.xz
lpage
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]