Commit 3a80af30 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[parser] Reserve initial vector memory rather than default construction

The constructor that accepts a size for vector default initializes the
elements. Using reserve() instead avoids this but still ensures the
capacity.

Change-Id: I8effb62ba1f9598a0081c2c959b2f7a5d6c587e6
Reviewed-on: https://chromium-review.googlesource.com/1186407Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55348}
parent c74babee
......@@ -1593,12 +1593,13 @@ ParserBase<Impl>::FunctionState::FunctionState(
outer_function_state_(*function_state_stack),
scope_(scope),
destructuring_assignments_to_rewrite_(scope->zone()),
reported_errors_(16, scope_->zone()),
reported_errors_(scope_->zone()),
dont_optimize_reason_(BailoutReason::kNoReason),
next_function_is_likely_called_(false),
previous_function_was_likely_called_(false),
contains_function_or_eval_(false) {
*function_state_stack = this;
reported_errors_.reserve(16);
if (outer_function_state_) {
outer_function_state_->previous_function_was_likely_called_ =
outer_function_state_->next_function_is_likely_called_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment