diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-09 03:03:36 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-09 06:44:21 +0800 |
commit | 96fe589f3ce4b8b2ca11fa7cff3f27a5acc83121 (patch) | |
tree | 228a6b99eccbce346fb2a66042dee8cde2d34eff /libjulia | |
parent | 9b61fb2e99a29ae97f6c29bc7309d70622b73886 (diff) | |
download | dexon-solidity-96fe589f3ce4b8b2ca11fa7cff3f27a5acc83121.tar.gz dexon-solidity-96fe589f3ce4b8b2ca11fa7cff3f27a5acc83121.tar.zst dexon-solidity-96fe589f3ce4b8b2ca11fa7cff3f27a5acc83121.zip |
Use removeEmptyBlocks helper in FunctionHoister
Diffstat (limited to 'libjulia')
-rw-r--r-- | libjulia/optimiser/FunctionHoister.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libjulia/optimiser/FunctionHoister.cpp b/libjulia/optimiser/FunctionHoister.cpp index 9cf67f23..63f6edb9 100644 --- a/libjulia/optimiser/FunctionHoister.cpp +++ b/libjulia/optimiser/FunctionHoister.cpp @@ -21,6 +21,7 @@ */ #include <libjulia/optimiser/FunctionHoister.h> +#include <libjulia/optimiser/Utilities.h> #include <libsolidity/inlineasm/AsmData.h> @@ -28,14 +29,11 @@ #include <libdevcore/CommonData.h> -#include <boost/range/algorithm_ext/erase.hpp> - using namespace std; using namespace dev; using namespace dev::julia; using namespace dev::solidity; - void FunctionHoister::operator()(Block& _block) { bool topLevel = m_isTopLevel; @@ -49,11 +47,7 @@ void FunctionHoister::operator()(Block& _block) statement = Block{_block.location, {}}; } } - auto isEmptyBlock = [](Statement const& _st) -> bool { - return _st.type() == typeid(Block) && boost::get<Block>(_st).statements.empty(); - }; - // Remove empty blocks - boost::range::remove_erase_if(_block.statements, isEmptyBlock); + removeEmptyBlocks(_block); if (topLevel) _block.statements += std::move(m_functions); } |