diff --git a/src/ripple/app/misc/impl/Manifest.cpp b/src/ripple/app/misc/impl/Manifest.cpp index 2b97250303e..6df5dd6b53d 100644 --- a/src/ripple/app/misc/impl/Manifest.cpp +++ b/src/ripple/app/misc/impl/Manifest.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/src/ripple/app/misc/impl/TxQ.cpp b/src/ripple/app/misc/impl/TxQ.cpp index bf6ef060e63..40d6aced37e 100644 --- a/src/ripple/app/misc/impl/TxQ.cpp +++ b/src/ripple/app/misc/impl/TxQ.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -111,11 +110,11 @@ TxQ::FeeMetrics::update( // Ledgers are taking to long to process, // so clamp down on limits. auto const cutPct = 100 - setup.slowConsensusDecreasePercent; - // upperLimit must be >= minimumTxnCount_ or boost::clamp can give + // upperLimit must be >= minimumTxnCount_ or std::clamp can give // unexpected results auto const upperLimit = std::max( mulDiv(txnsExpected_, cutPct, 100).second, minimumTxnCount_); - txnsExpected_ = boost::algorithm::clamp( + txnsExpected_ = std::clamp( mulDiv(size, cutPct, 100).second, minimumTxnCount_, upperLimit); recentTxnCounts_.clear(); } @@ -1885,7 +1884,7 @@ setup_TxQ(Config const& config) "normal_consensus_increase_percent", section); setup.normalConsensusIncreasePercent = - boost::algorithm::clamp(setup.normalConsensusIncreasePercent, 0, 1000); + std::clamp(setup.normalConsensusIncreasePercent, 0u, 1000u); /* If this percentage is outside of the 0-100 range, the results are nonsensical (uint overflows happen, so the limit grows @@ -1895,7 +1894,7 @@ setup_TxQ(Config const& config) "slow_consensus_decrease_percent", section); setup.slowConsensusDecreasePercent = - boost::algorithm::clamp(setup.slowConsensusDecreasePercent, 0, 100); + std::clamp(setup.slowConsensusDecreasePercent, 0u, 100u); set(setup.maximumTxnPerAccount, "maximum_txn_per_account", section); set(setup.minimumLastLedgerBuffer, "minimum_last_ledger_buffer", section); diff --git a/src/ripple/app/misc/impl/ValidatorSite.cpp b/src/ripple/app/misc/impl/ValidatorSite.cpp index 946f12f61c3..e82eba34ba2 100644 --- a/src/ripple/app/misc/impl/ValidatorSite.cpp +++ b/src/ripple/app/misc/impl/ValidatorSite.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include namespace ripple { @@ -468,10 +467,10 @@ ValidatorSite::parseJsonResponse( body[jss::refresh_interval].isNumeric()) { using namespace std::chrono_literals; - std::chrono::minutes const refresh = boost::algorithm::clamp( + std::chrono::minutes const refresh = std::clamp( std::chrono::minutes{body[jss::refresh_interval].asUInt()}, 1min, - 24h); + std::chrono::minutes{24h}); sites_[siteIdx].refreshInterval = refresh; sites_[siteIdx].nextRefresh = clock_type::now() + sites_[siteIdx].refreshInterval; diff --git a/src/ripple/app/paths/PathRequest.cpp b/src/ripple/app/paths/PathRequest.cpp index 489f271cc3d..adb0385283b 100644 --- a/src/ripple/app/paths/PathRequest.cpp +++ b/src/ripple/app/paths/PathRequest.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include @@ -624,8 +623,7 @@ PathRequest::findPaths( after four source currencies, 50 - (4 * 4) = 34. */ int const size = sourceCurrencies.size(); - consumer_.charge( - {boost::algorithm::clamp(size * size + 34, 50, 400), "path update"}); + consumer_.charge({std::clamp(size * size + 34, 50, 400), "path update"}); return true; } diff --git a/src/ripple/nodestore/impl/ShardInfo.cpp b/src/ripple/nodestore/impl/ShardInfo.cpp index ee3e5f194f5..fca828ab447 100644 --- a/src/ripple/nodestore/impl/ShardInfo.cpp +++ b/src/ripple/nodestore/impl/ShardInfo.cpp @@ -23,8 +23,6 @@ #include #include -#include - namespace ripple { namespace NodeStore { diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 103d21d80a5..2adc668ed18 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -40,7 +40,6 @@ #include #include -#include #include #include #include @@ -1825,7 +1824,7 @@ PeerImp::onMessage(std::shared_ptr const& m) // Preliminary check for the validity of the signature: A DER encoded // signature can't be longer than 72 bytes. - if ((boost::algorithm::clamp(sig.size(), 64, 72) != sig.size()) || + if ((std::clamp(sig.size(), 64, 72) != sig.size()) || (publicKeyType(makeSlice(set.nodepubkey())) != KeyType::secp256k1)) { JLOG(p_journal_.warn()) << "Proposal: malformed";