amv2: Simplify XmlObject get_enumerant_name

This commit is contained in:
Tom Schuster 2023-11-12 21:33:45 +01:00 committed by TÖRÖK Attila
parent 424821724f
commit 451e4bad10
1 changed files with 1 additions and 4 deletions

View File

@ -616,10 +616,7 @@ impl<'gc> TObject<'gc> for XmlObject<'gc> {
_activation: &mut Activation<'_, 'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
if index == 1 {
Ok(index
.checked_sub(1)
.map(|index| index.into())
.unwrap_or(Value::Undefined))
Ok(0.into())
} else {
Ok(Value::Undefined)
}