mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Replaced boost remove_erase and remove_erase_if
This commit is contained in:
parent
f162c484ca
commit
c4cf412fed
@ -25,7 +25,7 @@
|
|||||||
#include <libsolutil/CommonData.h>
|
#include <libsolutil/CommonData.h>
|
||||||
#include <libsolutil/Visitor.h>
|
#include <libsolutil/Visitor.h>
|
||||||
|
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
#include <range/v3/action/remove_if.hpp>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace solidity;
|
using namespace solidity;
|
||||||
@ -52,7 +52,7 @@ ExpressionStatement makeDiscardCall(
|
|||||||
|
|
||||||
void removeEmptyDefaultFromSwitch(Switch& _switchStmt)
|
void removeEmptyDefaultFromSwitch(Switch& _switchStmt)
|
||||||
{
|
{
|
||||||
boost::remove_erase_if(
|
ranges::actions::remove_if(
|
||||||
_switchStmt.cases,
|
_switchStmt.cases,
|
||||||
[](Case const& _case) { return !_case.value && _case.body.statements.empty(); }
|
[](Case const& _case) { return !_case.value && _case.body.statements.empty(); }
|
||||||
);
|
);
|
||||||
@ -69,7 +69,7 @@ void removeEmptyCasesFromSwitch(Switch& _switchStmt)
|
|||||||
if (hasDefault)
|
if (hasDefault)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boost::remove_erase_if(
|
ranges::actions::remove_if(
|
||||||
_switchStmt.cases,
|
_switchStmt.cases,
|
||||||
[](Case const& _case) { return _case.body.statements.empty(); }
|
[](Case const& _case) { return _case.body.statements.empty(); }
|
||||||
);
|
);
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
#include <libsolutil/CommonData.h>
|
#include <libsolutil/CommonData.h>
|
||||||
#include <libsolutil/cxx20.h>
|
#include <libsolutil/cxx20.h>
|
||||||
|
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
|
||||||
#include <range/v3/view/reverse.hpp>
|
#include <range/v3/view/reverse.hpp>
|
||||||
|
@ -24,8 +24,6 @@
|
|||||||
|
|
||||||
#include <libyul/AST.h>
|
#include <libyul/AST.h>
|
||||||
|
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace solidity;
|
using namespace solidity;
|
||||||
using namespace solidity::yul;
|
using namespace solidity::yul;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <liblangutil/Token.h>
|
#include <liblangutil/Token.h>
|
||||||
#include <libsolutil/CommonData.h>
|
#include <libsolutil/CommonData.h>
|
||||||
|
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
#include <range/v3/action/remove_if.hpp>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace solidity;
|
using namespace solidity;
|
||||||
@ -40,7 +40,7 @@ void yul::removeEmptyBlocks(Block& _block)
|
|||||||
auto isEmptyBlock = [](Statement const& _st) -> bool {
|
auto isEmptyBlock = [](Statement const& _st) -> bool {
|
||||||
return holds_alternative<Block>(_st) && std::get<Block>(_st).statements.empty();
|
return holds_alternative<Block>(_st) && std::get<Block>(_st).statements.empty();
|
||||||
};
|
};
|
||||||
boost::range::remove_erase_if(_block.statements, isEmptyBlock);
|
ranges::actions::remove_if(_block.statements, isEmptyBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool yul::isRestrictedIdentifier(Dialect const& _dialect, YulString const& _identifier)
|
bool yul::isRestrictedIdentifier(Dialect const& _dialect, YulString const& _identifier)
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <libsolutil/CommonData.h>
|
#include <libsolutil/CommonData.h>
|
||||||
|
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
#include <range/v3/action/remove_if.hpp>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace solidity;
|
using namespace solidity;
|
||||||
@ -307,7 +307,7 @@ void RedundantAssignEliminator::finalize(YulString _variable, RedundantAssignEli
|
|||||||
|
|
||||||
void AssignmentRemover::operator()(Block& _block)
|
void AssignmentRemover::operator()(Block& _block)
|
||||||
{
|
{
|
||||||
boost::range::remove_erase_if(_block.statements, [&](Statement const& _statement) -> bool {
|
ranges::actions::remove_if(_block.statements, [&](Statement const& _statement) -> bool {
|
||||||
return holds_alternative<Assignment>(_statement) && m_toRemove.count(&std::get<Assignment>(_statement));
|
return holds_alternative<Assignment>(_statement) && m_toRemove.count(&std::get<Assignment>(_statement));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -22,8 +22,6 @@
|
|||||||
#include <libsolutil/CommonData.h>
|
#include <libsolutil/CommonData.h>
|
||||||
#include <libsolutil/Visitor.h>
|
#include <libsolutil/Visitor.h>
|
||||||
|
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace solidity;
|
using namespace solidity;
|
||||||
using namespace solidity::yul;
|
using namespace solidity::yul;
|
||||||
|
@ -73,10 +73,10 @@
|
|||||||
|
|
||||||
#include <libsolutil/CommonData.h>
|
#include <libsolutil/CommonData.h>
|
||||||
|
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
|
||||||
#include <libyul/CompilabilityChecker.h>
|
#include <libyul/CompilabilityChecker.h>
|
||||||
|
|
||||||
#include <range/v3/view/map.hpp>
|
#include <range/v3/view/map.hpp>
|
||||||
|
#include <range/v3/action/remove.hpp>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace solidity;
|
using namespace solidity;
|
||||||
@ -312,8 +312,8 @@ void OptimiserSuite::runSequence(string const& _stepAbbreviations, Block& _ast)
|
|||||||
validateSequence(_stepAbbreviations);
|
validateSequence(_stepAbbreviations);
|
||||||
|
|
||||||
string input = _stepAbbreviations;
|
string input = _stepAbbreviations;
|
||||||
boost::remove_erase(input, ' ');
|
ranges::actions::remove(input, ' ');
|
||||||
boost::remove_erase(input, '\n');
|
ranges::actions::remove(input, '\n');
|
||||||
|
|
||||||
auto abbreviationsToSteps = [](string const& _sequence) -> vector<string>
|
auto abbreviationsToSteps = [](string const& _sequence) -> vector<string>
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,8 @@
|
|||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/algorithm/string/split.hpp>
|
#include <boost/algorithm/string/split.hpp>
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
|
||||||
|
#include <range/v3/action/remove_if.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -61,7 +62,7 @@ string ProtoConverter::createHex(string const& _hexBytes)
|
|||||||
string tmp{_hexBytes};
|
string tmp{_hexBytes};
|
||||||
if (!tmp.empty())
|
if (!tmp.empty())
|
||||||
{
|
{
|
||||||
boost::range::remove_erase_if(tmp, [=](char c) -> bool {
|
ranges::actions::remove_if(tmp, [=](char c) -> bool {
|
||||||
return !std::isxdigit(c);
|
return !std::isxdigit(c);
|
||||||
});
|
});
|
||||||
tmp = tmp.substr(0, 64);
|
tmp = tmp.substr(0, 64);
|
||||||
@ -83,7 +84,7 @@ string ProtoConverter::createAlphaNum(string const& _strBytes)
|
|||||||
string tmp{_strBytes};
|
string tmp{_strBytes};
|
||||||
if (!tmp.empty())
|
if (!tmp.empty())
|
||||||
{
|
{
|
||||||
boost::range::remove_erase_if(tmp, [=](char c) -> bool {
|
ranges::actions::remove_if(tmp, [=](char c) -> bool {
|
||||||
return !(std::isalpha(c) || std::isdigit(c));
|
return !(std::isalpha(c) || std::isdigit(c));
|
||||||
});
|
});
|
||||||
tmp = tmp.substr(0, 32);
|
tmp = tmp.substr(0, 32);
|
||||||
|
Loading…
Reference in New Issue
Block a user