Add benchmarks for switch statement.

This commit is contained in:
Stephen Chung
2020-11-13 19:35:51 +08:00
parent bc07b4fa84
commit b0c66eb5e5
2 changed files with 55 additions and 1 deletions

View File

@@ -2590,7 +2590,7 @@ fn parse_fn(
(Token::RightParen, _) => break,
(Token::Identifier(s), pos) => {
if params.iter().any(|(p, _)| p == &s) {
return Err(PERR::FnDuplicatedParam(name.to_string(), s).into_err(pos));
return Err(PERR::FnDuplicatedParam(name, s).into_err(pos));
}
let s = state.get_interned_string(s);
state.stack.push((s.clone(), ScopeEntryType::Normal));