[clang-tools-extra] r294974 - [clang-tidy] Reduce indentation. NFC.
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 13 10:03:10 PST 2017
Author: d0k
Date: Mon Feb 13 12:03:10 2017
New Revision: 294974
URL: http://llvm.org/viewvc/llvm-project?rev=294974&view=rev
Log:
[clang-tidy] Reduce indentation. NFC.
Modified:
clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp?rev=294974&r1=294973&r2=294974&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp Mon Feb 13 12:03:10 2017
@@ -269,16 +269,16 @@ void ClangTidyDiagnosticConsumer::finali
static bool LineIsMarkedWithNOLINT(SourceManager &SM, SourceLocation Loc) {
bool Invalid;
const char *CharacterData = SM.getCharacterData(Loc, &Invalid);
- if (!Invalid) {
- const char *P = CharacterData;
- while (*P != '\0' && *P != '\r' && *P != '\n')
- ++P;
- StringRef RestOfLine(CharacterData, P - CharacterData + 1);
- // FIXME: Handle /\bNOLINT\b(\([^)]*\))?/ as cpplint.py does.
- if (RestOfLine.find("NOLINT") != StringRef::npos) {
- return true;
- }
- }
+ if (Invalid)
+ return false;
+
+ const char *P = CharacterData;
+ while (*P != '\0' && *P != '\r' && *P != '\n')
+ ++P;
+ StringRef RestOfLine(CharacterData, P - CharacterData + 1);
+ // FIXME: Handle /\bNOLINT\b(\([^)]*\))?/ as cpplint.py does.
+ if (RestOfLine.find("NOLINT") != StringRef::npos)
+ return true;
return false;
}
More information about the cfe-commits
mailing list