aboutsummaryrefslogtreecommitdiff
path: root/node.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-02-16 15:43:35 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-02-16 15:43:35 -0700
commit459b8eb4ab16516974ff616196e4a2593ecbb7b7 (patch)
tree67cb8ddbbde55b26db5fb3a7463cd181e41be465 /node.go
parentMerge pull request #36 from benbjohnson/for-each (diff)
downloaddedo-459b8eb4ab16516974ff616196e4a2593ecbb7b7.tar.gz
dedo-459b8eb4ab16516974ff616196e4a2593ecbb7b7.tar.xz
Read-only transactional block.
Diffstat (limited to 'node.go')
-rw-r--r--node.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/node.go b/node.go
index ec49f11..68f651e 100644
--- a/node.go
+++ b/node.go
@@ -118,7 +118,7 @@ func (n *node) del(key []byte) {
index := sort.Search(len(n.inodes), func(i int) bool { return bytes.Compare(n.inodes[i].key, key) != -1 })
// Exit if the key isn't found.
- if !bytes.Equal(n.inodes[index].key, key) {
+ if index >= len(n.inodes) || !bytes.Equal(n.inodes[index].key, key) {
return
}