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

@@ -574,7 +574,7 @@ STTx::getBatchTransactionIDs() const
{
XRPL_ASSERT(getTxnType() == ttBATCH, "STTx::getBatchTransactionIDs : not a batch transaction");
XRPL_ASSERT(
getFieldArray(sfRawTransactions).size() != 0,
!getFieldArray(sfRawTransactions).empty(),
"STTx::getBatchTransactionIDs : empty raw transactions");
// The list of inner ids is built once, then reused on subsequent calls.
@@ -618,7 +618,7 @@ isMemoOkay(STObject const& st, std::string& reason)
{
auto memoObj = dynamic_cast<STObject const*>(&memo);
if (!memoObj || (memoObj->getFName() != sfMemo))
if ((memoObj == nullptr) || (memoObj->getFName() != sfMemo))
{
reason = "A memo array may contain only Memo objects.";
return false;
@@ -669,7 +669,7 @@ isMemoOkay(STObject const& st, std::string& reason)
for (unsigned char c : *optData)
{
if (!allowedSymbols[c])
if (allowedSymbols[c] == 0)
{
reason =
"The MemoType and MemoFormat fields may only "
@@ -691,7 +691,7 @@ isAccountFieldOkay(STObject const& st)
for (int i = 0; i < st.getCount(); ++i)
{
auto t = dynamic_cast<STAccount const*>(st.peekAtPIndex(i));
if (t && t->isDefault())
if ((t != nullptr) && t->isDefault())
return false;
}