From 16ae7e86d1d0694164a819dc74f928bdd958fd57 Mon Sep 17 00:00:00 2001 From: WangXiangUSTC Date: Sun, 29 Sep 2019 15:54:07 +0800 Subject: [PATCH 1/2] fix --- leveldb/table.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/leveldb/table.go b/leveldb/table.go index 5ad1f805..f0c932a9 100644 --- a/leveldb/table.go +++ b/leveldb/table.go @@ -305,7 +305,12 @@ func (tf tFiles) newIndexIterator(tops *tOps, icmp *iComparer, slice *util.Range } else { limit = tf.Len() } - tf = tf[start:limit] + if start > limit { + fmt.Printf("start is %d, limit is %d\n", start, limit) + ts = tf[start:start] + } else { + tf = tf[start:limit] + } } return iterator.NewArrayIndexer(&tFilesArrayIndexer{ tFiles: tf, From ea514d43ecec9465f1af2e64eba11f64dd4bdf52 Mon Sep 17 00:00:00 2001 From: WangXiangUSTC Date: Sun, 29 Sep 2019 15:59:46 +0800 Subject: [PATCH 2/2] minor fix --- leveldb/table.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leveldb/table.go b/leveldb/table.go index f0c932a9..527fe2ec 100644 --- a/leveldb/table.go +++ b/leveldb/table.go @@ -305,9 +305,9 @@ func (tf tFiles) newIndexIterator(tops *tOps, icmp *iComparer, slice *util.Range } else { limit = tf.Len() } + if start > limit { - fmt.Printf("start is %d, limit is %d\n", start, limit) - ts = tf[start:start] + tf = tf[limit:limit] } else { tf = tf[start:limit] }