diff --git a/src/data/CassandraBackend.hpp b/src/data/CassandraBackend.hpp index c3ffdff51..050260878 100644 --- a/src/data/CassandraBackend.hpp +++ b/src/data/CassandraBackend.hpp @@ -575,7 +575,7 @@ class BasicCassandraBackend : public BackendInterface { auto mptObjects = doFetchLedgerObjects(mptKeys, ledgerSequence, yield); - auto it = std::remove_if(mptObjects.begin(), mptObjects.end(), [](Blob const& mpt) { return mpt.size() == 0; }); + auto it = std::remove_if(mptObjects.begin(), mptObjects.end(), [](Blob const& mpt) { return mpt.empty(); }); mptObjects.erase(it, mptObjects.end()); @@ -948,7 +948,8 @@ class BasicCassandraBackend : public BackendInterface { writeMPTHolders(std::vector const& data) override { std::vector statements; - for (auto [mptId, holder] : data) + statements.reserve(data.size()); +for (auto [mptId, holder] : data) statements.push_back(schema_->insertMPTHolder.bind(std::move(mptId), std::move(holder))); executor_.write(std::move(statements)); diff --git a/src/etl/MPTHelpers.cpp b/src/etl/MPTHelpers.cpp index dd7126330..ba17d2b18 100644 --- a/src/etl/MPTHelpers.cpp +++ b/src/etl/MPTHelpers.cpp @@ -17,16 +17,21 @@ */ //============================================================================== -#include "data/BackendInterface.hpp" #include "data/DBHelpers.hpp" -#include "data/Types.hpp" -#include #include #include #include +#include +#include +#include +#include +#include +#include +#include -#include +#include +#include namespace etl { diff --git a/src/rpc/RPCHelpers.cpp b/src/rpc/RPCHelpers.cpp index 7e5aac451..1db828f12 100644 --- a/src/rpc/RPCHelpers.cpp +++ b/src/rpc/RPCHelpers.cpp @@ -81,6 +81,7 @@ #include #include +#include #include #include #include diff --git a/src/rpc/handlers/MPTHolders.cpp b/src/rpc/handlers/MPTHolders.cpp index 326859d05..e248297f1 100644 --- a/src/rpc/handlers/MPTHolders.cpp +++ b/src/rpc/handlers/MPTHolders.cpp @@ -24,17 +24,18 @@ #include "rpc/RPCHelpers.hpp" #include "rpc/common/Types.hpp" +#include #include #include #include #include #include #include -#include #include #include #include -#include +#include +#include #include #include @@ -73,7 +74,7 @@ MPTHoldersHandler::process(MPTHoldersHandler::Input input, Context const& ctx) c output.limit = limit; output.ledgerIndex = lgrInfo.seq; - boost::json::array mpts; + boost::json::array const mpts; for (auto const& mpt : dbResponse.mptokens) { ripple::STLedgerEntry const sle{ripple::SerialIter{mpt.data(), mpt.size()}, keylet::mptIssuance(mptID).key}; boost::json::object mptJson; diff --git a/tests/common/util/TestObject.cpp b/tests/common/util/TestObject.cpp index cc12b2df1..2f9e8bae7 100644 --- a/tests/common/util/TestObject.cpp +++ b/tests/common/util/TestObject.cpp @@ -1135,7 +1135,7 @@ CreateMPTokenObject(std::string_view accountId, ripple::uint192 issuanceID, std: mptoken.setFieldH256(ripple::sfPreviousTxnID, ripple::uint256{}); mptoken.setFieldU32(ripple::sfPreviousTxnLgrSeq, 0); - if (mptAmount) + if (mptAmount != 0u) mptoken.setFieldU64(ripple::sfMPTAmount, mptAmount); return mptoken; diff --git a/tests/unit/rpc/handlers/LedgerDataTests.cpp b/tests/unit/rpc/handlers/LedgerDataTests.cpp index 1c7842b57..676dde024 100644 --- a/tests/unit/rpc/handlers/LedgerDataTests.cpp +++ b/tests/unit/rpc/handlers/LedgerDataTests.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/tests/unit/rpc/handlers/MPTHoldersTests.cpp b/tests/unit/rpc/handlers/MPTHoldersTests.cpp index 984b71535..dbba7dc1d 100644 --- a/tests/unit/rpc/handlers/MPTHoldersTests.cpp +++ b/tests/unit/rpc/handlers/MPTHoldersTests.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include