Replace push_back with emplace_back where it makes sense

This commit is contained in:
Mathias Baumann
2018-12-10 19:02:39 +01:00
parent 871ea22bb9
commit 2f6dc2e773
15 changed files with 68 additions and 75 deletions
+10 -10
View File
@@ -46,22 +46,22 @@ bytes dev::lll::compileLLL(string const& _src, dev::solidity::EVMVersion _evmVer
{
if (_errors)
{
_errors->push_back("Parse error.");
_errors->push_back(boost::diagnostic_information(_e));
_errors->emplace_back("Parse error.");
_errors->emplace_back(boost::diagnostic_information(_e));
}
}
catch (std::exception const& _e)
{
if (_errors)
{
_errors->push_back("Parse exception.");
_errors->push_back(boost::diagnostic_information(_e));
_errors->emplace_back("Parse exception.");
_errors->emplace_back(boost::diagnostic_information(_e));
}
}
catch (...)
{
if (_errors)
_errors->push_back("Internal compiler exception.");
_errors->emplace_back("Internal compiler exception.");
}
return bytes();
}
@@ -84,22 +84,22 @@ std::string dev::lll::compileLLLToAsm(std::string const& _src, EVMVersion _evmVe
{
if (_errors)
{
_errors->push_back("Parse error.");
_errors->push_back(boost::diagnostic_information(_e));
_errors->emplace_back("Parse error.");
_errors->emplace_back(boost::diagnostic_information(_e));
}
}
catch (std::exception const& _e)
{
if (_errors)
{
_errors->push_back("Parse exception.");
_errors->push_back(boost::diagnostic_information(_e));
_errors->emplace_back("Parse exception.");
_errors->emplace_back(boost::diagnostic_information(_e));
}
}
catch (...)
{
if (_errors)
_errors->push_back("Internal compiler exception.");
_errors->emplace_back("Internal compiler exception.");
}
return string();
}