From 1f0dbdbbecd1d08f542094edd967bd163cb6fe06 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 27 Jan 2022 19:36:36 +0100 Subject: [PATCH] Clean up parameter access conditionals I forgot this works as an else if --- src/wrapper/vst3.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wrapper/vst3.rs b/src/wrapper/vst3.rs index b1edd39e..354b2a95 100644 --- a/src/wrapper/vst3.rs +++ b/src/wrapper/vst3.rs @@ -323,8 +323,7 @@ impl IEditController for Wrapper

{ } kResultOk - } else if self.param_id_hashes.contains_key(&id) { - let param_id = &self.param_id_hashes[&id]; + } else if let Some(param_id) = self.param_id_hashes.get(&id) { let param_ptr = &self.param_map[param_id]; u16strlcpy( dest, @@ -357,8 +356,7 @@ impl IEditController for Wrapper

{ *value_normalized = value; kResultOk - } else if self.param_id_hashes.contains_key(&id) { - let param_id = &self.param_id_hashes[&id]; + } else if let Some(param_id) = self.param_id_hashes.get(&id) { let param_ptr = &self.param_map[param_id]; let value = match param_ptr.string_to_normalized_value(&string) { Some(v) => v as f64,