aboutsummaryrefslogtreecommitdiff
path: root/cursor.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-02-15 23:38:03 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-02-15 23:45:17 -0700
commitd1952237edfbc3e2ab93a1109537c68144e9fd1e (patch)
tree76ad78453cbf13d069a9aa8c6490fd26da43aac1 /cursor.go
parentFix DB.opened flag. (diff)
downloaddedo-d1952237edfbc3e2ab93a1109537c68144e9fd1e.tar.gz
dedo-d1952237edfbc3e2ab93a1109537c68144e9fd1e.tar.xz
Improve test coverage.
Diffstat (limited to 'cursor.go')
-rw-r--r--cursor.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/cursor.go b/cursor.go
index a8a71b1..109cffb 100644
--- a/cursor.go
+++ b/cursor.go
@@ -154,9 +154,7 @@ func (c *Cursor) keyValue() ([]byte, []byte) {
// node returns the node that the cursor is currently positioned on.
func (c *Cursor) node(t *RWTransaction) *node {
- if len(c.stack) == 0 {
- return nil
- }
+ _assert(len(c.stack) > 0, "accessing a node with a zero-length cursor stack")
// Start from root and traverse down the hierarchy.
n := t.node(c.stack[0].page.id, nil)