mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +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
|
@ -162,7 +162,7 @@ ThrowCompletionOr<MarkedVector<Value>> StringObject::internal_own_property_keys(
|
|||
}
|
||||
|
||||
// 7. For each own property key P of O such that Type(P) is String and P is not an array index, in ascending chronological order of property creation, do
|
||||
for (auto& it : shape().property_table_ordered()) {
|
||||
for (auto& it : shape().property_table()) {
|
||||
if (it.key.is_string()) {
|
||||
// a. Add P as the last element of keys.
|
||||
keys.append(it.key.to_value(vm));
|
||||
|
@ -170,7 +170,7 @@ ThrowCompletionOr<MarkedVector<Value>> StringObject::internal_own_property_keys(
|
|||
}
|
||||
|
||||
// 8. For each own property key P of O such that Type(P) is Symbol, in ascending chronological order of property creation, do
|
||||
for (auto& it : shape().property_table_ordered()) {
|
||||
for (auto& it : shape().property_table()) {
|
||||
if (it.key.is_symbol()) {
|
||||
// a. Add P as the last element of keys.
|
||||
keys.append(it.key.to_value(vm));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue