Make next_items a SmallVec
.
For consistency, and to make the code slightly nicer.
This commit is contained in:
parent
c13ca42d67
commit
235a87fbd3
1 changed files with 2 additions and 3 deletions
|
@ -491,7 +491,7 @@ fn parse_tt_inner<'root, 'tt>(
|
||||||
sess: &ParseSess,
|
sess: &ParseSess,
|
||||||
ms: &[TokenTree],
|
ms: &[TokenTree],
|
||||||
cur_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
|
cur_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
|
||||||
next_items: &mut Vec<MatcherPosHandle<'root, 'tt>>,
|
next_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
|
||||||
bb_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
|
bb_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
|
||||||
token: &Token,
|
token: &Token,
|
||||||
) -> Option<NamedParseResult> {
|
) -> Option<NamedParseResult> {
|
||||||
|
@ -708,10 +708,9 @@ pub(super) fn parse_tt(
|
||||||
// there are frequently *no* others! -- are allocated on the heap.
|
// there are frequently *no* others! -- are allocated on the heap.
|
||||||
let mut initial = MatcherPos::new(ms);
|
let mut initial = MatcherPos::new(ms);
|
||||||
let mut cur_items = smallvec![MatcherPosHandle::Ref(&mut initial)];
|
let mut cur_items = smallvec![MatcherPosHandle::Ref(&mut initial)];
|
||||||
let mut next_items = Vec::new();
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
assert!(next_items.is_empty());
|
let mut next_items = SmallVec::new();
|
||||||
|
|
||||||
// Matcher positions black-box parsed by parser.rs (`parser`)
|
// Matcher positions black-box parsed by parser.rs (`parser`)
|
||||||
let mut bb_items = SmallVec::new();
|
let mut bb_items = SmallVec::new();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue