Skip to content

Commit

Permalink
fix cnt issues related to swap order
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmlm committed Jul 13, 2023
1 parent 5783e92 commit 7028182
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion utils/slot_db/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vsdb_slot_db"
version = "0.7.3"
version = "0.7.4"
edition = "2021"
keywords = ["database", "timestamp", "slot", "web"]
license = "MIT"
Expand Down
9 changes: 7 additions & 2 deletions utils/slot_db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,14 @@ where
/// Can also be used to do some `data statistics`
pub fn entry_cnt_within_two_slots(
&self,
slot_start: Slot,
slot_end: Slot,
mut slot_start: Slot,
mut slot_end: Slot,
) -> EntryCnt {
if self.swap_order {
(slot_start, slot_end) =
(swap_order(slot_end), swap_order(slot_start));
}

if slot_start > slot_end {
0
} else {
Expand Down

0 comments on commit 7028182

Please sign in to comment.