Replace boost::clamp with std::clamp

This commit is contained in:
Howard Hinnant
2021-08-11 15:19:12 -04:00
committed by Nik Bougalis
parent cf70ecbd6d
commit 9f75f2d522
6 changed files with 8 additions and 16 deletions

View File

@@ -41,7 +41,6 @@
#include <ripple/overlay/predicates.h>
#include <ripple/protocol/digest.h>
#include <boost/algorithm/clamp.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/beast/core/ostream.hpp>
@@ -1910,7 +1909,7 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMProposeSet> 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<std::size_t>(sig.size(), 64, 72) != sig.size()) ||
(publicKeyType(makeSlice(set.nodepubkey())) != KeyType::secp256k1))
{
JLOG(p_journal_.warn()) << "Proposal: malformed";