amv2: Simplify XmlObject get_enumerant_name
This commit is contained in:
parent
424821724f
commit
451e4bad10
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue