Skip to content

Commit 1a00072

Browse files
authored
style(clang-tidy): fix bugprone-branch-clone error (#1733)
Rest of the bugprone-branch-clone reports are false positives. The branches are different. Fixes #1654 Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
1 parent 35e4ba0 commit 1a00072

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/core/json/json_value.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,13 @@ auto JSON::operator-=(const JSON &substractive) -> JSON & {
355355
}
356356

357357
[[nodiscard]] auto JSON::is_integer_real() const noexcept -> bool {
358-
if (this->is_integer()) {
358+
if (!this->is_real()) {
359359
return false;
360-
} else if (this->is_real()) {
360+
} else {
361361
const auto value{this->to_real()};
362362
Real integral = 0.0;
363363
return !std::isinf(value) && !std::isnan(value) &&
364364
std::modf(value, &integral) == 0.0;
365-
} else {
366-
return false;
367365
}
368366
}
369367

0 commit comments

Comments
 (0)