From 12ffc8a347c9099060042b5e699843c84e08d62b Mon Sep 17 00:00:00 2001 From: Lord-McSweeney Date: Wed, 6 Mar 2024 17:50:17 -0800 Subject: [PATCH] avm2: Remove unused and unnecessary `init_slot` --- core/src/avm2/object.rs | 7 ------- core/src/avm2/object/script_object.rs | 15 --------------- 2 files changed, 22 deletions(-) diff --git a/core/src/avm2/object.rs b/core/src/avm2/object.rs index 465470024..d3dd1eb28 100644 --- a/core/src/avm2/object.rs +++ b/core/src/avm2/object.rs @@ -597,13 +597,6 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into> + Clone + Copy base.set_slot(id, value, activation.gc()) } - /// Initialize a slot by its index. - fn init_slot(self, id: u32, value: Value<'gc>, mc: &Mutation<'gc>) -> Result<(), Error<'gc>> { - let mut base = self.base_mut(mc); - - base.init_slot(id, value, mc) - } - /// Call a method by its index. /// /// This directly corresponds with the AVM2 operation `callmethod`. diff --git a/core/src/avm2/object/script_object.rs b/core/src/avm2/object/script_object.rs index 85439fe02..3187b6a38 100644 --- a/core/src/avm2/object/script_object.rs +++ b/core/src/avm2/object/script_object.rs @@ -286,21 +286,6 @@ impl<'gc> ScriptObjectData<'gc> { } } - /// Initialize a slot by its index. - pub fn init_slot( - &mut self, - id: u32, - value: Value<'gc>, - _mc: &Mutation<'gc>, - ) -> Result<(), Error<'gc>> { - if let Some(slot) = self.slots.get_mut(id as usize) { - *slot = value; - Ok(()) - } else { - Err(format!("Slot index {id} out of bounds!").into()) - } - } - pub fn install_instance_slots(&mut self) { use std::ops::Deref; let vtable = self.vtable.unwrap();