Refactor to extending from a drain instead of while looping.

This commit is contained in:
Mark-Simulacrum 2016-11-07 19:17:17 -07:00
parent 7221b07a07
commit c9e6089d29

View File

@ -453,9 +453,7 @@ pub fn parse(sess: &ParseSess, rdr: TtReader, ms: &[TokenTree]) -> NamedParseRes
return Failure(parser.span, parser.token);
} else if !next_eis.is_empty() {
/* Now process the next token */
while !next_eis.is_empty() {
cur_eis.push(next_eis.pop().unwrap());
}
cur_eis.extend(next_eis.drain(..));
parser.bump();
} else /* bb_eis.len() == 1 */ {
let mut ei = bb_eis.pop().unwrap();