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/UnusedPruner.cpp | |
parent | 0a96f091ab63e8d77106e00590a442c59714eecb (diff) | |
download | dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.gz dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.bz2 dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.lz dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.xz dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.tar.zst dexon-solidity-674e17c2a895eff6729357d8c10db709ac368b79.zip |
Performance: Replace string by special single-copy YulString class.
Diffstat (limited to 'libyul/optimiser/UnusedPruner.cpp')
-rw-r--r-- | libyul/optimiser/UnusedPruner.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libyul/optimiser/UnusedPruner.cpp b/libyul/optimiser/UnusedPruner.cpp index 37a74553..a7b32873 100644 --- a/libyul/optimiser/UnusedPruner.cpp +++ b/libyul/optimiser/UnusedPruner.cpp @@ -33,7 +33,7 @@ using namespace std; using namespace dev; using namespace dev::yul; -UnusedPruner::UnusedPruner(Block& _ast, set<string> const& _externallyUsedFunctions) +UnusedPruner::UnusedPruner(Block& _ast, set<YulString> const& _externallyUsedFunctions) { ReferencesCounter counter; counter(_ast); @@ -91,7 +91,7 @@ void UnusedPruner::operator()(Block& _block) ASTModifier::operator()(_block); } -void UnusedPruner::runUntilStabilised(Block& _ast, set<string> const& _externallyUsedFunctions) +void UnusedPruner::runUntilStabilised(Block& _ast, set<YulString> const& _externallyUsedFunctions) { while (true) { @@ -102,12 +102,12 @@ void UnusedPruner::runUntilStabilised(Block& _ast, set<string> const& _externall } } -bool UnusedPruner::used(string const& _name) const +bool UnusedPruner::used(YulString _name) const { return m_references.count(_name) && m_references.at(_name) > 0; } -void UnusedPruner::subtractReferences(map<string, size_t> const& _subtrahend) +void UnusedPruner::subtractReferences(map<YulString, size_t> const& _subtrahend) { for (auto const& ref: _subtrahend) { |