chore: Enable clang-tidy bugprone-optional-value-conversion check (#6470)

This commit is contained in:
Alex Kremer
2026-03-10 14:56:24 +00:00
committed by GitHub
parent 1a7d67c4db
commit a896ed3987
6 changed files with 7 additions and 7 deletions

View File

@@ -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,

View File

@@ -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);

View File

@@ -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))

View File

@@ -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));

View File

@@ -34,7 +34,7 @@ getDeliveredAmount(
if (auto const& deliveredAmount = transactionMeta.getDeliveredAmount();
deliveredAmount.has_value())
{
return *deliveredAmount;
return deliveredAmount;
}
if (serializedTx->isFieldPresent(sfAmount))

View File

@@ -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))
{