Skip to content

Commit 95bc553

Browse files
rodrigobaragliamatheusaaguiar
authored andcommitted
replace boost/range/for_each with standard for loop over rangev3/view/zip in ContractABIUtils::overwriteParameters
1 parent 63f8a93 commit 95bc553

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

test/libsolidity/util/ContractABIUtils.cpp

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#include <boost/algorithm/string.hpp>
3131
#include <boost/assign/list_of.hpp>
32-
#include <boost/range/algorithm_ext/for_each.hpp>
32+
#include <range/v3/view/zip.hpp>
3333

3434
#include <fstream>
3535
#include <memory>
@@ -281,26 +281,16 @@ void ContractABIUtils::overwriteParameters(
281281
)
282282
{
283283
using namespace placeholders;
284-
boost::for_each(
285-
_sourceParameters,
286-
_targetParameters,
287-
std::bind<void>(
288-
[&](Parameter _a, Parameter& _b) -> void
284+
for (auto&& [source, target]: ranges::views::zip(_sourceParameters, _targetParameters))
285+
if (
286+
source.abiType.size != target.abiType.size ||
287+
source.abiType.type != target.abiType.type ||
288+
source.abiType.fractionalDigits != target.abiType.fractionalDigits
289+
)
289290
{
290-
if (
291-
_a.abiType.size != _b.abiType.size ||
292-
_a.abiType.type != _b.abiType.type ||
293-
_a.abiType.fractionalDigits != _b.abiType.fractionalDigits
294-
)
295-
{
296-
_errorReporter.warning("Type or size of parameter(s) does not match.");
297-
_b = _a;
298-
}
299-
},
300-
_1,
301-
_2
302-
)
303-
);
291+
_errorReporter.warning("Type or size of parameter(s) does not match.");
292+
target = source;
293+
}
304294
}
305295

306296
solidity::frontend::test::ParameterList ContractABIUtils::preferredParameters(

0 commit comments

Comments
 (0)