mirror of
https://github.com/codex-storage/nim-leveldb.git
synced 2025-02-19 19:08:34 +00:00
fix: stop iter if prefix not matched
This commit is contained in:
parent
177190b311
commit
9d67cd79c8
@ -126,6 +126,8 @@ iterator iterPrefix*(self: LevelDb, prefix: string): (string, string) =
|
||||
for (key, value) in iter(self, prefix, reverse = false):
|
||||
if key.startsWith(prefix):
|
||||
yield (key, value)
|
||||
else:
|
||||
break
|
||||
|
||||
iterator iterRange*(self: LevelDb, start, limit: string): (string, string) =
|
||||
let reverse: bool = limit < start
|
||||
|
Loading…
x
Reference in New Issue
Block a user