Skip to content

Commit 6046595

Browse files
Use SmallVector for eof and bb eis.
1 parent b8d6686 commit 6046595

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/libsyntax/ext/tt/macro_parser.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ fn create_matches(len: usize) -> Vec<Vec<Rc<NamedMatch>>> {
279279

280280
fn inner_parse_loop(cur_eis: &mut SmallVector<Box<MatcherPos>>,
281281
next_eis: &mut Vec<Box<MatcherPos>>,
282-
eof_eis: &mut Vec<Box<MatcherPos>>,
283-
bb_eis: &mut Vec<Box<MatcherPos>>,
282+
eof_eis: &mut SmallVector<Box<MatcherPos>>,
283+
bb_eis: &mut SmallVector<Box<MatcherPos>>,
284284
token: &Token, span: &syntax_pos::Span) -> ParseResult<()> {
285285
while let Some(mut ei) = cur_eis.pop() {
286286
// When unzipped trees end, remove them
@@ -412,12 +412,10 @@ pub fn parse(sess: &ParseSess, rdr: TtReader, ms: &[TokenTree]) -> NamedParseRes
412412
let mut cur_eis = SmallVector::one(initial_matcher_pos(ms.to_owned(), parser.span.lo));
413413

414414
loop {
415-
let mut bb_eis = Vec::new(); // black-box parsed by parser.rs
415+
let mut bb_eis = SmallVector::new(); // black-box parsed by parser.rs
416+
let mut eof_eis = SmallVector::new();
416417
let mut next_eis = Vec::new(); // or proceed normally
417418

418-
// FIXME: Use SmallVector since in the successful case we will only have one
419-
let mut eof_eis = Vec::new();
420-
421419
match inner_parse_loop(&mut cur_eis, &mut next_eis, &mut eof_eis, &mut bb_eis,
422420
&parser.token, &parser.span) {
423421
Success(_) => {},

0 commit comments

Comments
 (0)