remove some allocations from process callback

This commit is contained in:
🪞👃🪞 2024-07-05 13:51:39 +03:00
parent 2e26fc2eaa
commit e83802e1fd
3 changed files with 109 additions and 113 deletions

View file

@ -68,12 +68,7 @@ impl Phrase {
}
LiveEvent::Midi { channel, message }.write(&mut buf).unwrap();
let t = *time as usize;
if output[t].is_none() {
output[t] = Some(vec![]);
}
if let Some(Some(frame)) = output.get_mut(t) {
frame.push(buf);
}
output[t].push(buf);
}
}
}