Skip to content

Commit 335cadd

Browse files
committed
pebble range fix
1 parent 396472e commit 335cadd

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)