1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:57:44 +00:00

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

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