From faa34a0a8b99bf96b624991f4fb36ebe642c13f8 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Mon, 3 May 2021 23:07:28 +0430 Subject: [PATCH] LibWasm: Do not resize() the function signature list to preallocate Instead, use `ensure_capacity()`. --- Userland/Libraries/LibWasm/Parser/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWasm/Parser/Parser.cpp b/Userland/Libraries/LibWasm/Parser/Parser.cpp index 227d9155bf..2dd0759b81 100644 --- a/Userland/Libraries/LibWasm/Parser/Parser.cpp +++ b/Userland/Libraries/LibWasm/Parser/Parser.cpp @@ -800,7 +800,7 @@ ParseResult FunctionSection::parse(InputStream& stream) return indices.error(); Vector typed_indices; - typed_indices.resize(indices.value().size()); + typed_indices.ensure_capacity(indices.value().size()); for (auto entry : indices.value()) typed_indices.append(entry);