diff --git a/core/src/avm2/array.rs b/core/src/avm2/array.rs index 9c499cab19fc6..fa69388c7271d 100644 --- a/core/src/avm2/array.rs +++ b/core/src/avm2/array.rs @@ -316,8 +316,8 @@ impl<'gc> ArrayStorage<'gc> { /// Convert the array to a dense representation if it meets the criteria. fn maybe_convert_to_dense(&mut self) { - if let ArrayStorage::Sparse { length, .. } = self { - if *length < MIN_SPARSE_LENGTH { + if let ArrayStorage::Sparse { storage, length } = self { + if storage.is_empty() && *length == 0 { *self = ArrayStorage::Dense { storage: Vec::new(), occupied_count: 0,