We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8bb7b3c commit bca2e2cCopy full SHA for bca2e2c
src/split_ticked_async_executor.rs
@@ -210,10 +210,14 @@ where
210
#[cfg(feature = "timer_registration")]
211
fn timer_registration_tick(&mut self, delta: f64) {
212
// Get new timers
213
- let mut new_timers = self.timer_registration_rx.try_iter().collect::<Vec<_>>();
214
- self.timers.append(&mut new_timers);
+ self.timer_registration_rx.try_iter().for_each(|timer| {
+ self.timers.push(timer);
215
+ });
216
217
// Countdown timers
218
+ if self.timers.is_empty() {
219
+ return;
220
+ }
221
self.timers.iter_mut().for_each(|(elapsed, _)| {
222
*elapsed -= delta;
223
});
0 commit comments