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. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits