mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 23:00:55 +00:00
refactor: Enable more clang-tidy readability checks (#6595)
Co-authored-by: Sergey Kuznetsov <kuzzz99@gmail.com>
This commit is contained in:
@@ -443,7 +443,7 @@ AMM::deposit(
|
||||
// If including asset1In and asset2In or tokens as
|
||||
// deposit min amounts then must set the flags
|
||||
// explicitly instead of relying on this logic.
|
||||
if (!(jvFlags & tfDepositSubTx))
|
||||
if ((jvFlags & tfDepositSubTx) == 0u)
|
||||
{
|
||||
if (tokens && !asset1In)
|
||||
{
|
||||
@@ -573,7 +573,7 @@ AMM::withdraw(
|
||||
std::uint32_t jvFlags = 0;
|
||||
if (flags)
|
||||
jvFlags = *flags;
|
||||
if (!(jvFlags & tfWithdrawSubTx))
|
||||
if ((jvFlags & tfWithdrawSubTx) == 0u)
|
||||
{
|
||||
if (tokens && !asset1Out)
|
||||
{
|
||||
|
||||
@@ -149,13 +149,13 @@ AMMTestBase::testAMM(std::function<void(jtx::AMM&, jtx::Env&)> const& cb, TestAM
|
||||
}
|
||||
|
||||
XRPAmount
|
||||
AMMTest::reserve(jtx::Env& env, std::uint32_t count) const
|
||||
AMMTest::reserve(jtx::Env& env, std::uint32_t count)
|
||||
{
|
||||
return env.current()->fees().accountReserve(count);
|
||||
}
|
||||
|
||||
XRPAmount
|
||||
AMMTest::ammCrtFee(jtx::Env& env) const
|
||||
AMMTest::ammCrtFee(jtx::Env& env)
|
||||
{
|
||||
return env.current()->fees().increment;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ Env::AppBundle::~AppBundle()
|
||||
client.reset();
|
||||
// Make sure all jobs finish, otherwise tests
|
||||
// might not get the coverage they expect.
|
||||
if (app)
|
||||
if (app != nullptr)
|
||||
{
|
||||
app->getJobQueue().rendezvous();
|
||||
app->signalStop("~AppBundle");
|
||||
@@ -218,6 +218,7 @@ Env::balance(Account const& account, MPTIssue const& mptIssue) const
|
||||
}
|
||||
|
||||
PrettyAmount
|
||||
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
|
||||
Env::balance(Account const& account, Asset const& asset) const
|
||||
{
|
||||
return std::visit([&](auto const& issue) { return balance(account, issue); }, asset.value());
|
||||
@@ -468,7 +469,7 @@ Env::postconditions(
|
||||
// we didn't get the expected result.
|
||||
return;
|
||||
}
|
||||
if (trace_)
|
||||
if (trace_ != 0)
|
||||
{
|
||||
if (trace_ > 0)
|
||||
--trace_;
|
||||
|
||||
@@ -258,7 +258,7 @@ Oracle::set(UpdateArg const& arg)
|
||||
return s;
|
||||
assert(s.size() <= 20);
|
||||
// anything else must be 160-bit hex string
|
||||
return strHex(s).append(40 - s.size() * 2, '0');
|
||||
return strHex(s).append(40 - (s.size() * 2), '0');
|
||||
};
|
||||
for (auto const& data : arg.series)
|
||||
{
|
||||
|
||||
@@ -370,7 +370,7 @@ MPTTester::set(MPTSet const& arg)
|
||||
.metadata = arg.metadata,
|
||||
.delegate = arg.delegate,
|
||||
.domainID = arg.domainID});
|
||||
if (submit(arg, jv) == tesSUCCESS && (arg.flags.value_or(0) || arg.mutableFlags))
|
||||
if (submit(arg, jv) == tesSUCCESS && ((arg.flags.value_or(0) != 0u) || arg.mutableFlags))
|
||||
{
|
||||
auto require = [&](std::optional<Account> const& holder, bool unchanged) {
|
||||
auto flags = getFlags(holder);
|
||||
|
||||
@@ -83,7 +83,7 @@ msig::operator()(Env& env, JTx& jt) const
|
||||
jo[sfTxnSignature.getJsonName()] = strHex(Slice{sig.data(), sig.size()});
|
||||
}
|
||||
};
|
||||
if (!subField)
|
||||
if (subField == nullptr)
|
||||
{
|
||||
jt.mainSigners.emplace_back(callback);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ offer(
|
||||
jv[jss::Account] = account.human();
|
||||
jv[jss::TakerPays] = takerPays.getJson(JsonOptions::none);
|
||||
jv[jss::TakerGets] = takerGets.getJson(JsonOptions::none);
|
||||
if (flags)
|
||||
if (flags != 0u)
|
||||
jv[jss::Flags] = flags;
|
||||
jv[jss::TransactionType] = jss::OfferCreate;
|
||||
return jv;
|
||||
|
||||
@@ -10,7 +10,7 @@ sig::operator()(Env&, JTx& jt) const
|
||||
{
|
||||
if (!manual_)
|
||||
return;
|
||||
if (!subField_)
|
||||
if (subField_ == nullptr)
|
||||
jt.fill_sig = false;
|
||||
if (account_)
|
||||
{
|
||||
@@ -22,7 +22,7 @@ sig::operator()(Env&, JTx& jt) const
|
||||
|
||||
jtx::sign(jtx.jv, account, sigObject);
|
||||
};
|
||||
if (!subField_)
|
||||
if (subField_ == nullptr)
|
||||
{
|
||||
jt.mainSigners.emplace_back(callback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user