chore: appease clippy

This commit is contained in:
Lord-McSweeney 2024-02-03 15:17:50 -08:00 committed by Lord-McSweeney
parent e227576093
commit 4da708edb8
2 changed files with 3 additions and 5 deletions

View File

@ -940,11 +940,9 @@ fn optimize<'gc>(
}; };
let stack_value = stack.pop(); let stack_value = stack.pop();
if resolved_type.is_some() { if resolved_type.is_some() && matches!(stack_value, Some(ValueType::Null)) {
if matches!(stack_value, Some(ValueType::Null)) {
*op = Op::Nop; *op = Op::Nop;
} }
}
if let Some(resolved_type) = resolved_type { if let Some(resolved_type) = resolved_type {
stack.push_class(resolved_type); stack.push_class(resolved_type);

View File

@ -167,7 +167,7 @@ impl<'gc> VTable<'gc> {
activation: &mut Activation<'_, 'gc>, activation: &mut Activation<'_, 'gc>,
) -> Result<Value<'gc>, Error<'gc>> { ) -> Result<Value<'gc>, Error<'gc>> {
// Drop the `write()` guard, as 'slot_class.coerce' may need to access this vtable. // Drop the `write()` guard, as 'slot_class.coerce' may need to access this vtable.
let mut slot_class = { self.0.read().slot_classes[slot_id as usize].clone() }; let mut slot_class = { self.0.read().slot_classes[slot_id as usize] };
let (value, changed) = slot_class.coerce(activation, value)?; let (value, changed) = slot_class.coerce(activation, value)?;