Merge pull request #13131 from rodrigobaraglia/develop

replace boost::range::for_each with range::views:zip + loop in file ContractABIUtils.cpp
This commit is contained in:
matheusaaguiar 2022-07-27 13:58:46 -03:00 committed by GitHub
commit 72f1907298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/assign/list_of.hpp> #include <boost/assign/list_of.hpp>
#include <boost/range/algorithm_ext/for_each.hpp> #include <range/v3/view/zip.hpp>
#include <fstream> #include <fstream>
#include <memory> #include <memory>
@ -281,26 +281,16 @@ void ContractABIUtils::overwriteParameters(
) )
{ {
using namespace placeholders; using namespace placeholders;
boost::for_each( for (auto&& [source, target]: ranges::views::zip(_sourceParameters, _targetParameters))
_sourceParameters, if (
_targetParameters, source.abiType.size != target.abiType.size ||
std::bind<void>( source.abiType.type != target.abiType.type ||
[&](Parameter _a, Parameter& _b) -> void source.abiType.fractionalDigits != target.abiType.fractionalDigits
)
{ {
if ( _errorReporter.warning("Type or size of parameter(s) does not match.");
_a.abiType.size != _b.abiType.size || target = source;
_a.abiType.type != _b.abiType.type || }
_a.abiType.fractionalDigits != _b.abiType.fractionalDigits
)
{
_errorReporter.warning("Type or size of parameter(s) does not match.");
_b = _a;
}
},
_1,
_2
)
);
} }
solidity::frontend::test::ParameterList ContractABIUtils::preferredParameters( solidity::frontend::test::ParameterList ContractABIUtils::preferredParameters(