about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorMark-Simulacrum <mark.simulacrum@gmail.com>2016-11-11 16:37:08 -0700
committerMark-Simulacrum <mark.simulacrum@gmail.com>2016-11-12 06:45:06 -0700
commit6046595e34737d7bec851bfd1352a01e58fe99e9 (patch)
treeb237e8888366b91aef294f69d4b645ec5804a366 /src/libsyntax
parentb8d6686ef3c2998d29c7ef531895ee05305cfef1 (diff)
downloadrust-6046595e34737d7bec851bfd1352a01e58fe99e9.tar.gz
rust-6046595e34737d7bec851bfd1352a01e58fe99e9.zip
Use SmallVector for eof and bb eis.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 3c57f7a05c2..a072f2ba948 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -279,8 +279,8 @@ fn create_matches(len: usize) -> Vec<Vec<Rc<NamedMatch>>> {
 
 fn inner_parse_loop(cur_eis: &mut SmallVector<Box<MatcherPos>>,
                     next_eis: &mut Vec<Box<MatcherPos>>,
-                    eof_eis: &mut Vec<Box<MatcherPos>>,
-                    bb_eis: &mut Vec<Box<MatcherPos>>,
+                    eof_eis: &mut SmallVector<Box<MatcherPos>>,
+                    bb_eis: &mut SmallVector<Box<MatcherPos>>,
                     token: &Token, span: &syntax_pos::Span) -> ParseResult<()> {
     while let Some(mut ei) = cur_eis.pop() {
         // When unzipped trees end, remove them
@@ -412,12 +412,10 @@ pub fn parse(sess: &ParseSess, rdr: TtReader, ms: &[TokenTree]) -> NamedParseRes
     let mut cur_eis = SmallVector::one(initial_matcher_pos(ms.to_owned(), parser.span.lo));
 
     loop {
-        let mut bb_eis = Vec::new(); // black-box parsed by parser.rs
+        let mut bb_eis = SmallVector::new(); // black-box parsed by parser.rs
+        let mut eof_eis = SmallVector::new();
         let mut next_eis = Vec::new(); // or proceed normally
 
-        // FIXME: Use SmallVector since in the successful case we will only have one
-        let mut eof_eis = Vec::new();
-
         match inner_parse_loop(&mut cur_eis, &mut next_eis, &mut eof_eis, &mut bb_eis,
                                &parser.token, &parser.span) {
             Success(_) => {},