Skip to content

Commit

Permalink
fix: query item range inclusive right to left bounds (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer authored Jul 6, 2024
1 parent a4326b7 commit d9814a2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions merk/src/proofs/query/query_item/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,13 @@ impl QueryItem {
iter.seek(end).flat_map(|_| iter.prev())
}
}
QueryItem::RangeInclusive(range_inclusive) => iter.seek(if left_to_right {
range_inclusive.start()
} else {
range_inclusive.end()
}),
QueryItem::RangeInclusive(range_inclusive) => {
if left_to_right {
iter.seek(range_inclusive.start())
} else {
iter.seek_for_prev(range_inclusive.end())
}
}
QueryItem::RangeFull(..) => {
if left_to_right {
iter.seek_to_first()
Expand Down

0 comments on commit d9814a2

Please sign in to comment.