[clang] a8b4b91 - [NFC][clang] Simplify `isOneOf` function

Shao-Ce SUN via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 24 03:12:41 PST 2022


Author: Shao-Ce SUN
Date: 2022-02-24T19:12:34+08:00
New Revision: a8b4b9104c8f7ab5edb8651a900e61279e8bf931

URL: https://github.com/llvm/llvm-project/commit/a8b4b9104c8f7ab5edb8651a900e61279e8bf931
DIFF: https://github.com/llvm/llvm-project/commit/a8b4b9104c8f7ab5edb8651a900e61279e8bf931.diff

LOG: [NFC][clang] Simplify `isOneOf` function

Reviewed By: tmatheson

Differential Revision: https://reviews.llvm.org/D117740

Added: 
    

Modified: 
    clang/include/clang/Lex/Token.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Lex/Token.h b/clang/include/clang/Lex/Token.h
index 00fbe6d18f721..7115d68f0f269 100644
--- a/clang/include/clang/Lex/Token.h
+++ b/clang/include/clang/Lex/Token.h
@@ -99,9 +99,8 @@ class Token {
   bool isOneOf(tok::TokenKind K1, tok::TokenKind K2) const {
     return is(K1) || is(K2);
   }
-  template <typename... Ts>
-  bool isOneOf(tok::TokenKind K1, tok::TokenKind K2, Ts... Ks) const {
-    return is(K1) || isOneOf(K2, Ks...);
+  template <typename... Ts> bool isOneOf(tok::TokenKind K1, Ts... Ks) const {
+    return is(K1) || isOneOf(Ks...);
   }
 
   /// Return true if this is a raw identifier (when lexing


        


More information about the cfe-commits mailing list