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.h | |
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/UnusedPruner.h')
-rw-r--r-- | libyul/optimiser/UnusedPruner.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libyul/optimiser/UnusedPruner.h b/libyul/optimiser/UnusedPruner.h index 30617ff3..2dd74940 100644 --- a/libyul/optimiser/UnusedPruner.h +++ b/libyul/optimiser/UnusedPruner.h @@ -21,8 +21,8 @@ #pragma once #include <libyul/optimiser/ASTWalker.h> +#include <libyul/YulString.h> -#include <string> #include <map> #include <set> @@ -44,7 +44,7 @@ namespace yul class UnusedPruner: public ASTModifier { public: - explicit UnusedPruner(Block& _ast, std::set<std::string> const& _externallyUsedFunctions = std::set<std::string>()); + explicit UnusedPruner(Block& _ast, std::set<YulString> const& _externallyUsedFunctions = {}); using ASTModifier::operator(); virtual void operator()(Block& _block) override; @@ -53,14 +53,14 @@ public: bool shouldRunAgain() const { return m_shouldRunAgain; } // Run the pruner until the code does not change anymore. - static void runUntilStabilised(Block& _ast, std::set<std::string> const& _externallyUsedFunctions = std::set<std::string>()); + static void runUntilStabilised(Block& _ast, std::set<YulString> const& _externallyUsedFunctions = {}); private: - bool used(std::string const& _name) const; - void subtractReferences(std::map<std::string, size_t> const& _subtrahend); + bool used(YulString _name) const; + void subtractReferences(std::map<YulString, size_t> const& _subtrahend); bool m_shouldRunAgain = false; - std::map<std::string, size_t> m_references; + std::map<YulString, size_t> m_references; }; } |