mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move NameDispenser into its own file.
This commit is contained in:
@@ -252,16 +252,3 @@ string BodyCopier::translateIdentifier(string const& _name)
|
||||
else
|
||||
return _name;
|
||||
}
|
||||
|
||||
string NameDispenser::newName(string const& _prefix)
|
||||
{
|
||||
string name = _prefix;
|
||||
size_t suffix = 0;
|
||||
while (name.empty() || m_usedNames.count(name))
|
||||
{
|
||||
suffix++;
|
||||
name = _prefix + "_" + std::to_string(suffix);
|
||||
}
|
||||
m_usedNames.insert(name);
|
||||
return name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user