Skip to content

Commit

Permalink
cleanup unnecessary else
Browse files Browse the repository at this point in the history
  • Loading branch information
ExpHP committed Jul 16, 2018
1 parent 191e76c commit 0467ae0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/libsyntax/ext/tt/macro_parser.rs
Expand Up @@ -696,16 +696,14 @@ pub fn parse(
} else {
return Failure(parser.span, token::Eof);
}
} else {
// Performance hack: eof_items may share matchers via Rc with other things that we want
// to modify. Dropping eof_items now may drop these refcounts to 1, preventing an
// unnecessary implicit clone later in Rc::make_mut.
drop(eof_items);
}
// Performance hack: eof_items may share matchers via Rc with other things that we want
// to modify. Dropping eof_items now may drop these refcounts to 1, preventing an
// unnecessary implicit clone later in Rc::make_mut.
drop(eof_items);

// Another possibility is that we need to call out to parse some rust nonterminal
// (black-box) parser. However, if there is not EXACTLY ONE of these, something is wrong.
assert!(!token_name_eq(&parser.token, &token::Eof));
if (!bb_items.is_empty() && !next_items.is_empty()) || bb_items.len() > 1 {
let nts = bb_items
.iter()
Expand Down

0 comments on commit 0467ae0

Please sign in to comment.