Merge pull request #11272 from ethereum/replace-boost-with-rangev3-solgen

Remove most boost usages in Yul proto converter
This commit is contained in:
chriseth 2021-04-21 12:21:57 +02:00 committed by GitHub
commit e2120f1f2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,11 +23,14 @@
#include <libsolutil/StringUtils.h>
#include <boost/algorithm/cxx11/all_of.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <range/v3/algorithm/all_of.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/range/algorithm_ext/erase.hpp>
#include <algorithm>
using namespace std;
using namespace solidity::yul::test::yul_fuzzer;
using namespace solidity::yul::test;
@ -1161,9 +1164,10 @@ void ProtoConverter::visit(CaseStmt const& _x)
// Ensure that all characters in the string literal except the first
// and the last (double quote characters) are alphanumeric.
yulAssert(
boost::algorithm::all_of(literal.begin() + 1, literal.end() - 2, [=](char c) -> bool {
return std::isalpha(c) || std::isdigit(c);
}),
ranges::all_of(
literal.begin() + 1,
literal.end() - 2,
[=](char c) { return isalpha(c) || isdigit(c); }),
"Proto fuzzer: Invalid string literal encountered"
);