diff options
author | Andreas Kling <kling@serenityos.org> | 2021-10-24 15:14:14 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-24 17:18:07 +0200 |
commit | 13f04e37e5005b92ea51996eff7466d9498b5684 (patch) | |
tree | 98deab10a9091aee71b89ba6b81f1f16f7392f57 /Userland/Libraries/LibJS/Bytecode/Generator.h | |
parent | 3117182c2ed010417d528421d727db4e97c2b2ce (diff) | |
download | serenity-13f04e37e5005b92ea51996eff7466d9498b5684.zip |
LibJS: Use String and move semantics in Bytecode::StringTable
Avoid creating new AK::String objects when we already have one.
Diffstat (limited to 'Userland/Libraries/LibJS/Bytecode/Generator.h')
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/Generator.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Generator.h b/Userland/Libraries/LibJS/Bytecode/Generator.h index a0491deaaf..e36702b29f 100644 --- a/Userland/Libraries/LibJS/Bytecode/Generator.h +++ b/Userland/Libraries/LibJS/Bytecode/Generator.h @@ -97,9 +97,9 @@ public: return m_current_basic_block->is_terminated(); } - StringTableIndex intern_string(StringView const& string) + StringTableIndex intern_string(String string) { - return m_string_table->insert(string); + return m_string_table->insert(move(string)); } bool is_in_generator_function() const { return m_is_in_generator_function; } |