From 96fe589f3ce4b8b2ca11fa7cff3f27a5acc83121 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 8 Feb 2018 19:03:36 +0000 Subject: [PATCH] Use removeEmptyBlocks helper in FunctionHoister --- libjulia/optimiser/FunctionHoister.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libjulia/optimiser/FunctionHoister.cpp b/libjulia/optimiser/FunctionHoister.cpp index 9cf67f231..63f6edb98 100644 --- a/libjulia/optimiser/FunctionHoister.cpp +++ b/libjulia/optimiser/FunctionHoister.cpp @@ -21,6 +21,7 @@ */ #include +#include #include @@ -28,14 +29,11 @@ #include -#include - 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(_st).statements.empty(); - }; - // Remove empty blocks - boost::range::remove_erase_if(_block.statements, isEmptyBlock); + removeEmptyBlocks(_block); if (topLevel) _block.statements += std::move(m_functions); }