diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp index d13a4f089f..2689d6f3d3 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp @@ -124,7 +124,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw) // 22.1.2.1 String.fromCharCode ( ...codeUnits ), https://tc39.es/ecma262/#sec-string.fromcharcode JS_DEFINE_NATIVE_FUNCTION(StringConstructor::from_char_code) { - Vector string; + Vector string; string.ensure_capacity(vm.argument_count()); for (size_t i = 0; i < vm.argument_count(); ++i) { diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index 6fb4f8d613..77b6bf9003 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -483,7 +483,7 @@ static Value pad_string(GlobalObject& global_object, Utf16String string, PadPlac if (max_length <= string_length) return js_string(vm, move(string)); - Utf16String fill_string(Vector { 0x20 }); + Utf16String fill_string(Vector { 0x20 }); if (!vm.argument(1).is_undefined()) { fill_string = vm.argument(1).to_utf16_string(global_object); if (vm.exception()) diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index e87ec1f189..406518807c 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -1106,7 +1106,7 @@ Value add(GlobalObject& global_object, Value lhs, Value rhs) auto const& lhs_utf16_string = lhs_string.utf16_string(); auto const& rhs_utf16_string = rhs_string.utf16_string(); - Vector combined; + Vector combined; combined.ensure_capacity(lhs_utf16_string.length_in_code_units() + rhs_utf16_string.length_in_code_units()); combined.extend(lhs_utf16_string.string()); combined.extend(rhs_utf16_string.string());