Skip to content

Commit

Permalink
Add an is_empty check before retrieving elapsed time.
Browse files Browse the repository at this point in the history
  • Loading branch information
niblak committed Jan 14, 2025
1 parent 3b32df5 commit ad5b9c8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions timely/src/scheduling/activate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ impl Activations {
}

// Drain timer-based activations.
let now = self.timer.elapsed();
while self.queue.peek().map(|Reverse((t,_))| t <= &now) == Some(true) {
let Reverse((_time, path)) = self.queue.pop().unwrap();
self.activate(&path[..]);
if !self.queue.is_empty() {
let now = self.timer.elapsed();
while self.queue.peek().map(|Reverse((t,_))| t <= &now) == Some(true) {
let Reverse((_time, path)) = self.queue.pop().unwrap();
self.activate(&path[..]);
}
}

self.bounds.drain(.. self.clean);
Expand Down

0 comments on commit ad5b9c8

Please sign in to comment.