mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-25 16:10:57 +00:00
chore: Enable clang-tidy bugprone-optional-value-conversion check (#6470)
This commit is contained in:
@@ -30,6 +30,7 @@ Checks: "-*,
|
||||
bugprone-multiple-statement-macro,
|
||||
bugprone-no-escape,
|
||||
bugprone-non-zero-enum-to-bool-conversion,
|
||||
bugprone-optional-value-conversion,
|
||||
bugprone-parent-virtual-call,
|
||||
bugprone-pointer-arithmetic-on-polymorphic-object,
|
||||
bugprone-posix-return,
|
||||
@@ -97,7 +98,6 @@ Checks: "-*,
|
||||
# bugprone-inc-dec-in-conditions,
|
||||
# bugprone-move-forwarding-reference,
|
||||
# bugprone-switch-missing-default-case,
|
||||
# bugprone-optional-value-conversion,
|
||||
# bugprone-unused-return-value,
|
||||
# bugprone-use-after-move,
|
||||
# bugprone-unhandled-self-assignment,
|
||||
|
||||
@@ -86,7 +86,7 @@ Permission::getPermissionName(std::uint32_t const value) const
|
||||
{
|
||||
auto const permissionValue = static_cast<GranularPermissionType>(value);
|
||||
if (auto const granular = getGranularName(permissionValue))
|
||||
return *granular;
|
||||
return granular;
|
||||
|
||||
// not a granular permission, check if it maps to a transaction type
|
||||
auto const txType = permissionToTxType(value);
|
||||
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
if (has(SB::sameAccIss))
|
||||
return acc;
|
||||
if (has(SB::existingIss) && existingIss)
|
||||
return *existingIss;
|
||||
return existingIss;
|
||||
return issF().id();
|
||||
}();
|
||||
auto const cur = [&]() -> std::optional<Currency> {
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
if (has(SB::xrp))
|
||||
return xrpCurrency();
|
||||
if (has(SB::existingCur) && existingCur)
|
||||
return *existingCur;
|
||||
return existingCur;
|
||||
return currencyF();
|
||||
}();
|
||||
if (!has(SB::boundary))
|
||||
|
||||
@@ -297,7 +297,7 @@ private:
|
||||
auto const localSigningPublic =
|
||||
parseBase58<PublicKey>(TokenType::NodePublic, cfgKeys.front());
|
||||
|
||||
BEAST_EXPECT(trustedKeys->load(*localSigningPublic, cfgKeys, emptyCfgPublishers));
|
||||
BEAST_EXPECT(trustedKeys->load(localSigningPublic, cfgKeys, emptyCfgPublishers));
|
||||
|
||||
BEAST_EXPECT(trustedKeys->localPublicKey() == localSigningPublic);
|
||||
BEAST_EXPECT(trustedKeys->listed(*localSigningPublic));
|
||||
|
||||
@@ -34,7 +34,7 @@ getDeliveredAmount(
|
||||
if (auto const& deliveredAmount = transactionMeta.getDeliveredAmount();
|
||||
deliveredAmount.has_value())
|
||||
{
|
||||
return *deliveredAmount;
|
||||
return deliveredAmount;
|
||||
}
|
||||
|
||||
if (serializedTx->isFieldPresent(sfAmount))
|
||||
|
||||
@@ -126,7 +126,7 @@ autofillTx(Json::Value& tx_json, RPC::JsonContext& context)
|
||||
}
|
||||
|
||||
if (auto error = autofillSignature(tx_json))
|
||||
return *error;
|
||||
return error;
|
||||
|
||||
if (!tx_json.isMember(jss::Sequence))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user