Skip to content

Commit d332773

Browse files
authored
Merge pull request #501 from VolodymyrBg/bg
fix: off-by-one in includer cache window trimming
2 parents e69d087 + 6d349de commit d332773

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

timeboost-sequencer/src/include.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ impl Includer {
6767

6868
self.round = round;
6969

70+
// Ensure cache has an entry for this round.
71+
self.cache.entry(self.round).or_default();
72+
7073
while self.cache.len() > CACHE_SIZE {
7174
self.cache.pop_first();
7275
}
7376

74-
// Ensure cache has an entry for this round.
75-
self.cache.entry(self.round).or_default();
76-
7777
self.time = {
7878
let mut times = lists
7979
.iter()

0 commit comments

Comments
 (0)