aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp b/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
index ee19796..a78d07d 100644
--- a/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
+++ b/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
@@ -20,7 +20,7 @@ namespace clang::tidy::abseil {
/// Returns an integer if the fractional part of a `FloatingLiteral` is `0`.
static std::optional<llvm::APSInt>
truncateIfIntegral(const FloatingLiteral &FloatLiteral) {
- double Value = FloatLiteral.getValueAsApproximateDouble();
+ const double Value = FloatLiteral.getValueAsApproximateDouble();
if (std::fmod(Value, 1) == 0) {
if (Value >= static_cast<double>(1U << 31))
return std::nullopt;
@@ -69,7 +69,7 @@ rewriteInverseDurationCall(const MatchFinder::MatchResult &Result,
static std::optional<std::string>
rewriteInverseTimeCall(const MatchFinder::MatchResult &Result,
DurationScale Scale, const Expr &Node) {
- llvm::StringRef InverseFunction = getTimeInverseForScale(Scale);
+ const llvm::StringRef InverseFunction = getTimeInverseForScale(Scale);
if (const auto *MaybeCallArg = selectFirst<const Expr>(
"e", match(callExpr(callee(functionDecl(hasName(InverseFunction))),
hasArgument(0, expr().bind("e"))),