Skip to content

Commit 7fd0a21

Browse files
Apply suggestions from code review
Co-authored-by: Baranov Victor <[email protected]>
1 parent a500961 commit 7fd0a21

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,12 @@ void UseNumericLimitsCheck::check(const MatchFinder::MatchResult &Result) {
110110
const IntegerLiteral *BareMatchedDecl =
111111
Result.Nodes.getNodeAs<IntegerLiteral>("bare-integer-literal");
112112

113-
if (NegativeMatchedDecl != nullptr) {
113+
if (NegativeMatchedDecl != nullptr)
114114
MatchedDecl = NegativeMatchedDecl;
115-
} else if (PositiveMatchedDecl != nullptr) {
115+
else if (PositiveMatchedDecl != nullptr)
116116
MatchedDecl = PositiveMatchedDecl;
117-
} else if (BareMatchedDecl != nullptr) {
117+
else if (BareMatchedDecl != nullptr)
118118
MatchedDecl = BareMatchedDecl;
119-
}
120119

121120
const llvm::APInt MatchedIntegerConstant = MatchedDecl->getValue();
122121

@@ -151,13 +150,11 @@ void UseNumericLimitsCheck::check(const MatchFinder::MatchResult &Result) {
151150
Result.SourceManager->getFileID(Location), "<limits>");
152151
};
153152

154-
for (const auto &[Value, Replacement] : SignedConstants) {
153+
for (const auto &[Value, Replacement] : SignedConstants)
155154
Fixer(MatchedIntegerConstant.getSExtValue(), Value, Replacement);
156-
}
157155

158-
for (const auto &[Value, Replacement] : UnsignedConstants) {
156+
for (const auto &[Value, Replacement] : UnsignedConstants)
159157
Fixer(MatchedIntegerConstant.getZExtValue(), Value, Replacement);
160-
}
161158
}
162159

163160
} // namespace clang::tidy::readability

0 commit comments

Comments
 (0)