diff options
author | chriseth <chris@ethereum.org> | 2018-10-29 22:12:02 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-11-08 02:30:27 +0800 |
commit | 674e17c2a895eff6729357d8c10db709ac368b79 (patch) | |
tree | 300a55700b068709f36340563db1b43e5b8b1188 /libyul/optimiser/SSATransform.cpp | |
parent | 0a96f091ab63e8d77106e00590a442c59714eecb (diff) | |
download | dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.gz dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.zst dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.zip |
Performance: Replace string by special single-copy YulString class.
Diffstat (limited to 'libyul/optimiser/SSATransform.cpp')
-rw-r--r-- | libyul/optimiser/SSATransform.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libyul/optimiser/SSATransform.cpp b/libyul/optimiser/SSATransform.cpp index 9db7bd03..f209ee7b 100644 --- a/libyul/optimiser/SSATransform.cpp +++ b/libyul/optimiser/SSATransform.cpp @@ -62,15 +62,15 @@ void SSATransform::operator()(ForLoop& _for) void SSATransform::operator()(Block& _block) { - set<string> variablesToClearAtEnd; + set<YulString> variablesToClearAtEnd; // Creates a new variable (and returns its declaration) with value _value // and replaces _value by a reference to that new variable. - auto replaceByNew = [&](SourceLocation _loc, string _varName, string _type, shared_ptr<Expression>& _value) -> VariableDeclaration + auto replaceByNew = [&](SourceLocation _loc, YulString _varName, YulString _type, shared_ptr<Expression>& _value) -> VariableDeclaration { - string newName = m_nameDispenser.newName(_varName); + YulString newName = m_nameDispenser.newName(_varName); m_currentVariableValues[_varName] = newName; - variablesToClearAtEnd.insert(_varName); + variablesToClearAtEnd.emplace(_varName); shared_ptr<Expression> v = make_shared<Expression>(Identifier{_loc, newName}); _value.swap(v); return VariableDeclaration{_loc, {TypedName{_loc, std::move(newName), std::move(_type)}}, std::move(v)}; |