LibJS: Avoid an unnecessary Vector copy in IndexedProperties::indices()

This commit is contained in:
Andreas Kling 2021-02-17 15:23:32 +01:00
parent ee1b58bf41
commit ea81a4a529
Notes: sideshowbarker 2024-07-18 22:11:53 +09:00

View file

@ -374,7 +374,7 @@ Vector<u32> IndexedProperties::indices() const
}
} else {
const auto& storage = static_cast<const GenericIndexedPropertyStorage&>(*m_storage);
const auto packed_elements = storage.packed_elements();
const auto& packed_elements = storage.packed_elements();
indices.ensure_capacity(storage.array_like_size());
for (size_t i = 0; i < packed_elements.size(); ++i) {
if (!packed_elements.at(i).value.is_empty())