avm2: Remove unused and unnecessary `init_slot`

This commit is contained in:
Lord-McSweeney 2024-03-06 17:50:17 -08:00 committed by Lord-McSweeney
parent d3e12e4a24
commit 12ffc8a347
2 changed files with 0 additions and 22 deletions

View File

@ -597,13 +597,6 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + 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`.

View File

@ -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();