aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/YulString.h
diff options
context:
space:
mode:
Diffstat (limited to 'libyul/YulString.h')
-rw-r--r--libyul/YulString.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/libyul/YulString.h b/libyul/YulString.h
index ae01c83f..a8015239 100644
--- a/libyul/YulString.h
+++ b/libyul/YulString.h
@@ -35,9 +35,9 @@ namespace yul
class YulStringRepository: boost::noncopyable
{
public:
- YulStringRepository(): m_strings{std::make_shared<std::string>()}
+ YulStringRepository()
{
- m_ids[std::string{}] = 0;
+ reset();
}
static YulStringRepository& instance()
{
@@ -61,6 +61,14 @@ public:
return *m_strings.at(_id);
}
+ void reset()
+ {
+ m_strings.clear();
+ m_ids.clear();
+ m_strings.emplace_back(std::make_shared<std::string>());
+ m_ids[std::string{}] = 0;
+ }
+
private:
std::vector<std::shared_ptr<std::string>> m_strings;
std::map<std::string, size_t> m_ids;