mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
perf(transformer): create Vec with capacity (#3613)
Tiny optimization. Where we know the required capacity of a `Vec`, initialize it with that capacity.
This commit is contained in:
parent
0fb4c35083
commit
f4c1389e99
1 changed files with 1 additions and 1 deletions
|
|
@ -131,7 +131,7 @@ impl<'a> ReactJsxSource<'a> {
|
|||
self.ctx.ast.object_property(SPAN, kind, key, value, None, false, false, false)
|
||||
};
|
||||
|
||||
let mut properties = self.ctx.ast.new_vec();
|
||||
let mut properties = self.ctx.ast.new_vec_with_capacity(3);
|
||||
properties.push(ObjectPropertyKind::ObjectProperty(filename));
|
||||
properties.push(ObjectPropertyKind::ObjectProperty(line_number));
|
||||
properties.push(ObjectPropertyKind::ObjectProperty(column_number));
|
||||
|
|
|
|||
Loading…
Reference in a new issue