This commit is contained in:
@@ -85,7 +85,7 @@ pub fn dispatcher_loop(
|
||||
let current_us = link.clock_micros() as SyncTime;
|
||||
while let Some(cmd) = queue.peek() {
|
||||
if cmd.target_time_us <= current_us + SPIN_THRESHOLD_US {
|
||||
let cmd = queue.pop().unwrap();
|
||||
let cmd = queue.pop().expect("pop after peek");
|
||||
wait_until_dispatch(cmd.target_time_us, &link, has_rt);
|
||||
dispatch_midi(cmd.command, &midi_tx);
|
||||
} else {
|
||||
@@ -149,8 +149,8 @@ mod tests {
|
||||
target_time_us: 200,
|
||||
});
|
||||
|
||||
assert_eq!(heap.pop().unwrap().target_time_us, 100);
|
||||
assert_eq!(heap.pop().unwrap().target_time_us, 200);
|
||||
assert_eq!(heap.pop().unwrap().target_time_us, 300);
|
||||
assert_eq!(heap.pop().expect("heap non-empty").target_time_us, 100);
|
||||
assert_eq!(heap.pop().expect("heap non-empty").target_time_us, 200);
|
||||
assert_eq!(heap.pop().expect("heap non-empty").target_time_us, 300);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user