Skip to content

Commit b21e738

Browse files
committed
Optimize mbe matcher allocations: performance issue #7857
1 parent 2955c45 commit b21e738

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/mbe/src/expander/matcher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ fn match_loop_inner<'t>(
377377
bindings_builder: &mut BindingsBuilder<'t>,
378378
cur_items: &mut SmallVec<[MatchState<'t>; 1]>,
379379
bb_items: &mut SmallVec<[MatchState<'t>; 1]>,
380-
next_items: &mut Vec<MatchState<'t>>,
380+
next_items: &mut SmallVec<[MatchState<'t>; 4]>,
381381
eof_items: &mut SmallVec<[MatchState<'t>; 1]>,
382382
error_items: &mut SmallVec<[MatchState<'t>; 1]>,
383383
delim_span: tt::DelimSpan<Span>,
@@ -650,7 +650,7 @@ fn match_loop<'t>(
650650
meta_result: None,
651651
}];
652652

653-
let mut next_items = vec![];
653+
let mut next_items: SmallVec<[MatchState<'t>; 4]> = SmallVec::new();
654654

655655
loop {
656656
let mut bb_items = SmallVec::new();

0 commit comments

Comments
 (0)