From af2aee930f8a6de92392f1889acf7198378caf78 Mon Sep 17 00:00:00 2001 From: Frederich Munch Date: Fri, 16 Feb 2018 16:07:33 +0000 Subject: [PATCH] Use Token::isOneOf method in Parser. Summary: Easier to read and possibly optimize. Reviewers: rsmith, sepavloff Reviewed By: sepavloff Subscribers: sepavloff, cfe-commits Differential Revision: https://reviews.llvm.org/D36701 llvm-svn: 325352 --- clang/include/clang/Parse/Parser.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h index ec8e60815a67..3bf3855419fe 100644 --- a/clang/include/clang/Parse/Parser.h +++ b/clang/include/clang/Parse/Parser.h @@ -379,15 +379,15 @@ private: /// isTokenParen - Return true if the cur token is '(' or ')'. bool isTokenParen() const { - return Tok.getKind() == tok::l_paren || Tok.getKind() == tok::r_paren; + return Tok.isOneOf(tok::l_paren, tok::r_paren); } /// isTokenBracket - Return true if the cur token is '[' or ']'. bool isTokenBracket() const { - return Tok.getKind() == tok::l_square || Tok.getKind() == tok::r_square; + return Tok.isOneOf(tok::l_square, tok::r_square); } /// isTokenBrace - Return true if the cur token is '{' or '}'. bool isTokenBrace() const { - return Tok.getKind() == tok::l_brace || Tok.getKind() == tok::r_brace; + return Tok.isOneOf(tok::l_brace, tok::r_brace); } /// isTokenStringLiteral - True if this token is a string-literal. bool isTokenStringLiteral() const {