mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-06 10:16:45 +00:00
refactor: Enable more clang-tidy readability checks (#6595)
Co-authored-by: Sergey Kuznetsov <kuzzz99@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user