Skip to content

Commit e8393c3

Browse files
authored
Merge pull request #59 from ucwong/dev
pebble range fix
2 parents ce1ed67 + 335cadd commit e8393c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pebble/pebble.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ func (peb *Pebble) Range(start, limit []byte) (res [][]byte) {
139139
iter := peb.engine.NewIter(nil)
140140
defer iter.Close()
141141
for iter.SeekGEWithLimit(start, limit); iter.Valid(); iter.Next() {
142-
res = append(res, common.SafeCopy(nil, iter.Value()))
142+
if bytes.Compare(limit, iter.Key()) > 0 {
143+
res = append(res, common.SafeCopy(nil, iter.Value()))
144+
} else {
145+
break
146+
}
143147
}
144148
return
145149
}

0 commit comments

Comments
 (0)