From f1e7a2a9cc74b19597e9d7105852daf4672514a2 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Wed, 22 Feb 2023 22:17:45 +0800 Subject: [PATCH] chore(es/parser): Reduce pre-allocation to reduce memory usage (#6979) **Related issue:** - Closes https://github.com/swc-project/swc/issues/6966. --- crates/swc_ecma_parser/src/parser/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/swc_ecma_parser/src/parser/expr.rs b/crates/swc_ecma_parser/src/parser/expr.rs index 62986026b298..0689f2c4806a 100644 --- a/crates/swc_ecma_parser/src/parser/expr.rs +++ b/crates/swc_ecma_parser/src/parser/expr.rs @@ -712,7 +712,7 @@ impl Parser { expect!(p, '('); let mut first = true; - let mut expr_or_spreads = Vec::with_capacity(8); + let mut expr_or_spreads = Vec::with_capacity(2); while !eof!(p) && !is!(p, ')') { if first {