Performance: Replace string by special single-copy YulString class.

This commit is contained in:
chriseth
2018-11-07 19:30:27 +01:00
parent 0a96f091ab
commit 674e17c2a8
59 changed files with 351 additions and 243 deletions
@@ -44,7 +44,7 @@ void InlinableExpressionFunctionFinder::operator()(FunctionDefinition const& _fu
{
if (_function.returnVariables.size() == 1 && _function.body.statements.size() == 1)
{
string const& retVariable = _function.returnVariables.front().name;
YulString retVariable = _function.returnVariables.front().name;
Statement const& bodyStatement = _function.body.statements.front();
if (bodyStatement.type() == typeid(Assignment))
{
@@ -57,7 +57,7 @@ void InlinableExpressionFunctionFinder::operator()(FunctionDefinition const& _fu
// would not be valid here if we were searching inside a functionally inlinable
// function body.
assertThrow(m_disallowedIdentifiers.empty() && !m_foundDisallowedIdentifier, OptimizerException, "");
m_disallowedIdentifiers = set<string>{retVariable, _function.name};
m_disallowedIdentifiers = set<YulString>{retVariable, _function.name};
boost::apply_visitor(*this, *assignment.value);
if (!m_foundDisallowedIdentifier)
m_inlinableFunctions[_function.name] = &_function;