refactor: Enable more clang-tidy readability checks (#6595)

Co-authored-by: Sergey Kuznetsov <kuzzz99@gmail.com>
This commit is contained in:
Alex Kremer
2026-03-24 15:42:12 +00:00
committed by GitHub
parent 8b986e4ab0
commit 0eedefbf45
248 changed files with 948 additions and 935 deletions

View File

@@ -152,7 +152,7 @@ STAmount::STAmount(SerialIter& sit, SField const& name) : STBase(name)
value &= ~(1023ull << (64 - 10));
if (value)
if (value != 0u)
{
bool isNegative = (offset & 256) == 0;
offset = (offset & 255) - 97; // center the range
@@ -505,14 +505,11 @@ canAdd(STAmount const& a, STAmount const& b)
XRPAmount A = a.xrp();
XRPAmount B = b.xrp();
if ((B > XRPAmount{0} &&
return !(
(B > XRPAmount{0} &&
A > XRPAmount{std::numeric_limits<XRPAmount::value_type>::max()} - B) ||
(B < XRPAmount{0} &&
A < XRPAmount{std::numeric_limits<XRPAmount::value_type>::min()} - B))
{
return false;
}
return true;
A < XRPAmount{std::numeric_limits<XRPAmount::value_type>::min()} - B));
}
// IOU case (precision check)
@@ -530,15 +527,11 @@ canAdd(STAmount const& a, STAmount const& b)
{
MPTAmount A = a.mpt();
MPTAmount B = b.mpt();
if ((B > MPTAmount{0} &&
return !(
(B > MPTAmount{0} &&
A > MPTAmount{std::numeric_limits<MPTAmount::value_type>::max()} - B) ||
(B < MPTAmount{0} &&
A < MPTAmount{std::numeric_limits<MPTAmount::value_type>::min()} - B))
{
return false;
}
return true;
A < MPTAmount{std::numeric_limits<MPTAmount::value_type>::min()} - B));
}
// LCOV_EXCL_START
UNREACHABLE("STAmount::canAdd : unexpected STAmount type");
@@ -803,7 +796,7 @@ bool
STAmount::isEquivalent(STBase const& t) const
{
STAmount const* v = dynamic_cast<STAmount const*>(&t);
return v && (*v == *this);
return (v != nullptr) && (*v == *this);
}
bool