mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:47:34 +00:00
LibJS: Use OrderedHashMap for the Shape property table
This allows us to get rid of property_table_ordered() which was a heavy-handed way of iterating properties in insertion order by first copying them to a sorted Vector. Clients can now simply iterate property_table() directly. 3% speed-up on Kraken/ai-astar.js :^)
This commit is contained in:
parent
8ce9e51c97
commit
e33145aa4b
7 changed files with 13 additions and 27 deletions
|
@ -400,13 +400,13 @@ JS::ThrowCompletionOr<JS::MarkedVector<JS::Value>> LegacyPlatformObject::interna
|
|||
}
|
||||
|
||||
// 4. For each P of O’s own property keys that is a String, in ascending chronological order of property creation, append P to keys.
|
||||
for (auto& it : shape().property_table_ordered()) {
|
||||
for (auto& it : shape().property_table()) {
|
||||
if (it.key.is_string())
|
||||
keys.append(it.key.to_value(vm));
|
||||
}
|
||||
|
||||
// 5. For each P of O’s own property keys that is a Symbol, in ascending chronological order of property creation, append P to keys.
|
||||
for (auto& it : shape().property_table_ordered()) {
|
||||
for (auto& it : shape().property_table()) {
|
||||
if (it.key.is_symbol())
|
||||
keys.append(it.key.to_value(vm));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue