@@ -86,9 +86,9 @@ class UseCppStyleCommentsCheck::CStyleCommentHandler : public CommentHandler {
8686 " //" + Line.str ()));
8787 }
8888
89- if (NewlinePos == StringRef::npos) {
89+ if (NewlinePos == StringRef::npos)
9090 break ;
91- }
91+
9292 CommentText = CommentText.substr (NewlinePos + 1 );
9393 LineNo++;
9494 }
@@ -108,9 +108,9 @@ class UseCppStyleCommentsCheck::CStyleCommentHandler : public CommentHandler {
108108 CommentEnd = Range.getEnd ();
109109 const std::optional<Token> NextTok =
110110 Lexer::findNextToken (CommentStart, SM, PP.getLangOpts ());
111- if (!NextTok.has_value ()) {
111+ if (!NextTok.has_value ())
112112 return false ;
113- }
113+
114114 const std::string tokenSpelling =
115115 Lexer::getSpelling (*NextTok, SM, PP.getLangOpts ());
116116 const unsigned lineNo = SM.getSpellingLineNumber (CommentEnd);
@@ -122,9 +122,8 @@ class UseCppStyleCommentsCheck::CStyleCommentHandler : public CommentHandler {
122122 bool HandleComment (Preprocessor &PP, SourceRange Range) override {
123123 const SourceManager &SM = PP.getSourceManager ();
124124
125- if (Range.getBegin ().isMacroID () || SM.isInSystemHeader (Range.getBegin ())) {
125+ if (Range.getBegin ().isMacroID () || SM.isInSystemHeader (Range.getBegin ()))
126126 return false ;
127- }
128127
129128 const StringRef Text = Lexer::getSourceText (
130129 CharSourceRange::getCharRange (Range), SM, PP.getLangOpts ());
@@ -135,18 +134,15 @@ class UseCppStyleCommentsCheck::CStyleCommentHandler : public CommentHandler {
135134 } else if (ExcludedCommentMatch.match (Text)) {
136135 return false ;
137136 }
138- if (ExcludeDoxygen && isDoxygenStyleComment (Text)) {
137+ if (ExcludeDoxygen && isDoxygenStyleComment (Text))
139138 return false ;
140- }
141139
142140 SmallVector<StringRef> Matches;
143- if (!CStyleCommentMatch.match (Text, &Matches)) {
141+ if (!CStyleCommentMatch.match (Text, &Matches))
144142 return false ;
145- }
146143
147- if (CheckForCodeAfterComment (PP, Range)) {
144+ if (CheckForCodeAfterComment (PP, Range))
148145 return false ;
149- }
150146
151147 SmallVector<FixItHint, 4 > FixIts;
152148 convertToCppStyleCommentFixes (SM, Range, FixIts);
@@ -155,9 +151,8 @@ class UseCppStyleCommentsCheck::CStyleCommentHandler : public CommentHandler {
155151 Range.getBegin (),
156152 " use C++ style comments '//' instead of C style comments '/*...*/'" );
157153
158- for (const auto &Fix : FixIts) {
154+ for (const auto &Fix : FixIts)
159155 D << Fix;
160- }
161156
162157 return false ;
163158 }
0 commit comments