1
0
Fork 0

Change single branch match to if let

This commit is contained in:
Robbert van der Helm 2022-07-25 14:39:43 +02:00
parent 1fbcd583a4
commit 3ffc2f0604

View file

@ -249,9 +249,13 @@ impl Plugin for PolyModSynth {
normalized_offset,
} => {
// Polyphonic modulation events are matched to voices using the
// voice ID, and to parameters using the poly modulation ID
match self.get_voice_idx(voice_id) {
Some(voice_idx) => {
// voice ID, and to parameters using the poly modulation ID. The
// host will probably send a modulation event every N samples. This
// will happen before the voice is active, and of course also after
// it has been terminated (because the host doesn't know that it
// will be). Because of that, we won't print any assertion failures
// when we can't find the voice index here.
if let Some(voice_idx) = self.get_voice_idx(voice_id) {
let voice = self.voices[voice_idx].as_mut().unwrap();
match poly_modulation_id {
@ -282,10 +286,8 @@ impl Plugin for PolyModSynth {
{
smoother.reset(target_plain_value);
} else {
smoother.set_target(
sample_rate,
target_plain_value,
);
smoother
.set_target(sample_rate, target_plain_value);
}
}
n => nih_debug_assert_failure!(
@ -295,13 +297,6 @@ impl Plugin for PolyModSynth {
),
}
}
// The host will probably send a modulation event every N
// samples. This will happen before the voice is active, and of
// course also after it has been terminated (because the host
// doesn't know that it will be). Because of that, we won't
// print any assertion failures here.
None => (),
}
}
NoteEvent::MonoAutomation {
timing: _,