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

@@ -40,7 +40,7 @@ class AMMCalc_test : public beast::unit_test::suite
boost::regex rx("^([^(]+)[(]([^)]+)[)]([)])?$");
if (boost::regex_search(str, match, rx))
{
if (delimited)
if (delimited != nullptr)
*delimited = (match[3] != "");
if (match[1] == "XRP")
{
@@ -72,7 +72,7 @@ class AMMCalc_test : public beast::unit_test::suite
// input is rate * 100, no fraction
std::uint32_t rate = 10'000'000 * std::stoi(match[2].str());
// true if delimited - )
return {{currency, rate, match[3] != "" ? true : false}};
return {{currency, rate, match[3] != ""}};
}
return std::nullopt;
}
@@ -94,7 +94,7 @@ class AMMCalc_test : public beast::unit_test::suite
if (p == end_)
return std::nullopt;
std::string const s = *p;
bool const amm = s[0] == 'O' ? false : true;
bool const amm = s[0] != 'O';
auto const a1 = getAmt(p++);
if (!a1 || p == end_)
return std::nullopt;
@@ -161,7 +161,7 @@ class AMMCalc_test : public beast::unit_test::suite
return {{pairs, *swap, *rate, fee}};
}
std::string
static std::string
toString(STAmount const& a)
{
std::stringstream str;
@@ -169,7 +169,7 @@ class AMMCalc_test : public beast::unit_test::suite
return str.str();
}
STAmount
static STAmount
mulratio(STAmount const& amt, std::uint32_t a, std::uint32_t b, bool round)
{
if (a == b)
@@ -179,7 +179,7 @@ class AMMCalc_test : public beast::unit_test::suite
return toSTAmount(mulRatio(amt.iou(), a, b, round), amt.issue());
}
void
static void
swapOut(swapargs const& args)
{
auto const vp = std::get<steps>(args);
@@ -242,7 +242,7 @@ class AMMCalc_test : public beast::unit_test::suite
std::cout << "in: " << toString(resultIn) << " out: " << toString(resultOut) << std::endl;
}
void
static void
swapIn(swapargs const& args)
{
auto const vp = std::get<steps>(args);