summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Bytecode/Generator.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-10-24 15:14:14 +0200
committerAndreas Kling <kling@serenityos.org>2021-10-24 17:18:07 +0200
commit13f04e37e5005b92ea51996eff7466d9498b5684 (patch)
tree98deab10a9091aee71b89ba6b81f1f16f7392f57 /Userland/Libraries/LibJS/Bytecode/Generator.h
parent3117182c2ed010417d528421d727db4e97c2b2ce (diff)
downloadserenity-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.h4
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; }