Use single counter for name dispenser for performance reasons.

This commit is contained in:
chriseth
2018-11-07 23:09:33 +01:00
parent deed8e21f6
commit 845899e305
16 changed files with 67 additions and 67 deletions
+2 -3
View File
@@ -52,11 +52,10 @@ YulString NameDispenser::newName(YulString _nameHint, YulString _context)
YulString NameDispenser::newNameInternal(YulString _nameHint)
{
YulString name = _nameHint;
size_t suffix = 0;
while (name.empty() || m_usedNames.count(name))
{
suffix++;
name = YulString(_nameHint.str() + "_" + to_string(suffix));
m_counter++;
name = YulString(_nameHint.str() + "_" + to_string(m_counter));
}
m_usedNames.emplace(name);
return name;