1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-30 10:12:07 +00:00

LibJS: Use FlyString for identifiers

This makes variable and property lookups a lot faster since comparing
two FlyStrings is O(1).
This commit is contained in:
Andreas Kling 2020-03-22 11:07:55 +01:00
parent 4f72f6b886
commit cccbe43056
19 changed files with 67 additions and 57 deletions

View file

@ -59,7 +59,7 @@ void Array::visit_children(Cell::Visitor& visitor)
visitor.visit(element);
}
Optional<Value> Array::get_own_property(const String& property_name) const
Optional<Value> Array::get_own_property(const FlyString& property_name) const
{
bool ok;
i32 index = property_name.to_int(ok);
@ -70,7 +70,7 @@ Optional<Value> Array::get_own_property(const String& property_name) const
return Object::get_own_property(property_name);
}
bool Array::put_own_property(const String& property_name, Value value)
bool Array::put_own_property(const FlyString& property_name, Value value)
{
bool ok;
i32 index = property_name.to_int(ok);