mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11980 from ethereum/useIterateReplacingInStatementRemover
Use iterateReplacing in StatementRemover.
This commit is contained in:
commit
0d7f6598e8
@ -159,8 +159,15 @@ void RedundantStoreBase::merge(TrackedStores& _target, vector<TrackedStores>&& _
|
|||||||
|
|
||||||
void StatementRemover::operator()(Block& _block)
|
void StatementRemover::operator()(Block& _block)
|
||||||
{
|
{
|
||||||
ranges::actions::remove_if(_block.statements, [&](Statement const& _statement) -> bool {
|
util::iterateReplacing(
|
||||||
return m_toRemove.count(&_statement);
|
_block.statements,
|
||||||
});
|
[&](Statement& _statement) -> std::optional<vector<Statement>>
|
||||||
|
{
|
||||||
|
if (m_toRemove.count(&_statement))
|
||||||
|
return {vector<Statement>{}};
|
||||||
|
else
|
||||||
|
return nullopt;
|
||||||
|
}
|
||||||
|
);
|
||||||
ASTModifier::operator()(_block);
|
ASTModifier::operator()(_block);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user