From d1952237edfbc3e2ab93a1109537c68144e9fd1e Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sat, 15 Feb 2014 23:38:03 -0700 Subject: Improve test coverage. --- cursor.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cursor.go') 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) -- cgit v1.2.3