diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-22 11:07:55 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-22 13:03:43 +0100 |
commit | cccbe43056748a9443a49abf5bdc938ba5e537d6 (patch) | |
tree | 09767cad7e20b1494f8ab23b7c8e31677cbd2970 /Libraries/LibJS/Runtime/Array.cpp | |
parent | 4f72f6b8866cfa353a29248a4f1ca7c242949231 (diff) | |
download | serenity-cccbe43056748a9443a49abf5bdc938ba5e537d6.zip |
LibJS: Use FlyString for identifiers
This makes variable and property lookups a lot faster since comparing
two FlyStrings is O(1).
Diffstat (limited to 'Libraries/LibJS/Runtime/Array.cpp')
-rw-r--r-- | Libraries/LibJS/Runtime/Array.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibJS/Runtime/Array.cpp b/Libraries/LibJS/Runtime/Array.cpp index e8cfb28f1b..cab66eb3a5 100644 --- a/Libraries/LibJS/Runtime/Array.cpp +++ b/Libraries/LibJS/Runtime/Array.cpp @@ -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); |