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/RedundantAssignEliminator.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/RedundantAssignEliminator.cpp')
-rw-r--r-- | libyul/optimiser/RedundantAssignEliminator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libyul/optimiser/RedundantAssignEliminator.cpp b/libyul/optimiser/RedundantAssignEliminator.cpp index 478858e4..775b7673 100644 --- a/libyul/optimiser/RedundantAssignEliminator.cpp +++ b/libyul/optimiser/RedundantAssignEliminator.cpp @@ -44,7 +44,7 @@ void RedundantAssignEliminator::operator()(VariableDeclaration const& _variableD ASTWalker::operator()(_variableDeclaration); for (auto const& var: _variableDeclaration.variables) - m_declaredVariables.insert(var.name); + m_declaredVariables.emplace(var.name); } void RedundantAssignEliminator::operator()(Assignment const& _assignment) @@ -156,7 +156,7 @@ void RedundantAssignEliminator::run(Block& _ast) { assertThrow(assignment.second != State::Undecided, OptimizerException, ""); if (assignment.second == State::Unused && MovableChecker{*assignment.first->value}.movable()) - assignmentsToRemove.insert(assignment.first); + assignmentsToRemove.emplace(assignment.first); } AssignmentRemover remover{assignmentsToRemove}; @@ -176,7 +176,7 @@ void RedundantAssignEliminator::join(RedundantAssignEliminator& _other) m_assignments[var.first] = std::move(var.second); } -void RedundantAssignEliminator::changeUndecidedTo(string const& _variable, RedundantAssignEliminator::State _newState) +void RedundantAssignEliminator::changeUndecidedTo(YulString _variable, RedundantAssignEliminator::State _newState) { for (auto& assignment: m_assignments[_variable]) if (assignment.second == State{State::Undecided}) |