[clang] a1db435 - [clang-format][NFC] Don't pass member by argument

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 5 03:32:15 PST 2022


Author: Björn Schäpers
Date: 2022-01-05T12:31:34+01:00
New Revision: a1db43539027898cbd200798c4549115d261ed86

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

LOG: [clang-format][NFC] Don't pass member by argument

And then use the argument and member.

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

Added: 
    

Modified: 
    clang/lib/Format/TokenAnnotator.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 5b3a450e31f2..54c2a62542b9 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -75,7 +75,7 @@ class AnnotatingParser {
       : Style(Style), Line(Line), CurrentToken(Line.First), AutoFound(false),
         Keywords(Keywords) {
     Contexts.push_back(Context(tok::unknown, 1, /*IsExpression=*/false));
-    resetTokenMetadata(CurrentToken);
+    resetTokenMetadata();
   }
 
 private:
@@ -1409,8 +1409,8 @@ class AnnotatingParser {
            Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
   }
 
-  void resetTokenMetadata(FormatToken *Token) {
-    if (!Token)
+  void resetTokenMetadata() {
+    if (!CurrentToken)
       return;
 
     // Reset token type in case we have already looked at it and then
@@ -1439,7 +1439,7 @@ class AnnotatingParser {
       CurrentToken = CurrentToken->Next;
     }
 
-    resetTokenMetadata(CurrentToken);
+    resetTokenMetadata();
   }
 
   /// A struct to hold information valid in a specific context, e.g.


        


More information about the cfe-commits mailing list