mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11210 from anurag-git/issue_10738-2
Use range-v3 loops(transform)
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <libsolutil/Algorithms.h>
|
||||
|
||||
#include <boost/range/adaptor/transformed.hpp>
|
||||
#include <range/v3/view/transform.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity::langutil;
|
||||
@@ -344,7 +344,7 @@ void DeclarationTypeChecker::endVisit(VariableDeclaration const& _variable)
|
||||
{
|
||||
errorString = "Data location must be " +
|
||||
util::joinHumanReadable(
|
||||
allowedDataLocations | boost::adaptors::transformed(locationToString),
|
||||
allowedDataLocations | ranges::views::transform(locationToString),
|
||||
", ",
|
||||
" or "
|
||||
);
|
||||
|
||||
@@ -42,11 +42,11 @@
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/range/adaptor/sliced.hpp>
|
||||
#include <boost/range/adaptor/transformed.hpp>
|
||||
#include <boost/range/algorithm/copy.hpp>
|
||||
|
||||
#include <range/v3/view/enumerate.hpp>
|
||||
#include <range/v3/view/reverse.hpp>
|
||||
#include <range/v3/view/transform.hpp>
|
||||
|
||||
#include <limits>
|
||||
#include <unordered_set>
|
||||
@@ -227,7 +227,7 @@ string richIdentifier(Type const* _type)
|
||||
|
||||
string identifierList(vector<Type const*> const& _list)
|
||||
{
|
||||
return identifierList(_list | boost::adaptors::transformed(richIdentifier));
|
||||
return identifierList(_list | ranges::views::transform(richIdentifier));
|
||||
}
|
||||
|
||||
string identifierList(Type const* _type)
|
||||
@@ -2374,7 +2374,7 @@ string StructType::signatureInExternalFunction(bool _structsByName) const
|
||||
else
|
||||
{
|
||||
TypePointers memberTypes = memoryMemberTypes();
|
||||
auto memberTypeStrings = memberTypes | boost::adaptors::transformed([&](Type const* _t) -> string
|
||||
auto memberTypeStrings = memberTypes | ranges::views::transform([&](Type const* _t) -> string
|
||||
{
|
||||
solAssert(_t, "Parameter should have external type.");
|
||||
auto t = _t->interfaceType(_structsByName);
|
||||
@@ -3439,7 +3439,7 @@ string FunctionType::externalSignature() const
|
||||
|
||||
solAssert(extParams.message().empty(), extParams.message());
|
||||
|
||||
auto typeStrings = extParams.get() | boost::adaptors::transformed([&](Type const* _t) -> string
|
||||
auto typeStrings = extParams.get() | ranges::views::transform([&](Type const* _t) -> string
|
||||
{
|
||||
string typeName = _t->signatureInExternalFunction(inLibrary);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include <libsolutil/FunctionSelector.h>
|
||||
#include <libsolutil/Visitor.h>
|
||||
|
||||
#include <boost/range/adaptor/transformed.hpp>
|
||||
#include <range/v3/view/transform.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
@@ -1037,7 +1037,7 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
|
||||
templ("encode", abi.tupleEncoder(nonIndexedArgTypes, nonIndexedParamTypes));
|
||||
templ("nonIndexedArgs", joinHumanReadablePrefixed(nonIndexedArgs));
|
||||
templ("log", "log" + to_string(indexedArgs.size()));
|
||||
templ("indexedArgs", joinHumanReadablePrefixed(indexedArgs | boost::adaptors::transformed([&](auto const& _arg) {
|
||||
templ("indexedArgs", joinHumanReadablePrefixed(indexedArgs | ranges::views::transform([&](auto const& _arg) {
|
||||
return _arg.commaSeparatedList();
|
||||
})));
|
||||
m_code << templ.render();
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <libsolidity/codegen/ir/Common.h>
|
||||
#include <libsolidity/codegen/ir/IRVariable.h>
|
||||
#include <libsolidity/ast/AST.h>
|
||||
#include <boost/range/adaptor/transformed.hpp>
|
||||
#include <libsolutil/StringUtils.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
Reference in New Issue
Block a user