Skip to content

Commit 01bc74c

Browse files
committed
feedback
1 parent 26ebe24 commit 01bc74c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clang-tools-extra/clang-tidy/modernize/UseStartsEndsWithCheck.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ void UseStartsEndsWithCheck::check(const MatchFinder::MatchResult &Result) {
222222
if (FindExpr->getNumArgs() == 0)
223223
return;
224224

225-
const bool Neg = isNegativeComparison(ComparisonExpr);
226-
227225
// Retrieve the source text of the search expression.
228226
const auto SearchExprText = Lexer::getSourceText(
229227
CharSourceRange::getTokenRange(SearchExpr->getSourceRange()),
@@ -247,7 +245,7 @@ void UseStartsEndsWithCheck::check(const MatchFinder::MatchResult &Result) {
247245
(SearchExprText + ")").str());
248246

249247
// Add negation if necessary.
250-
if (Neg)
248+
if (isNegativeComparison(ComparisonExpr))
251249
Diagnostic << FixItHint::CreateInsertion(FindExpr->getBeginLoc(), "!");
252250
}
253251

0 commit comments

Comments
 (0)