diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-15 23:38:03 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-15 23:38:03 -0700 |
commit | 0bf796c9deeb19564bcd7fc5ded57031fe7ceb57 (patch) | |
tree | 00359a50db7088ddf23af3c863fc5fc99fc3d142 /cursor.go | |
parent | Fix DB.opened flag. (diff) | |
download | dedo-0bf796c9deeb19564bcd7fc5ded57031fe7ceb57.tar.gz dedo-0bf796c9deeb19564bcd7fc5ded57031fe7ceb57.tar.xz |
Improve test coverage.
Diffstat (limited to 'cursor.go')
-rw-r--r-- | cursor.go | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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) |