aboutsummaryrefslogtreecommitdiffstats
path: root/libjulia/optimiser/Disambiguator.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-05-09 07:45:50 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-05-09 07:45:50 +0800
commit3b241843a77ed29d10355fc17383da18d979bc5b (patch)
tree64c1ca423862dcea7df7fdd9d3f7a8a15834395f /libjulia/optimiser/Disambiguator.cpp
parent10792dbc909bdd2c8ba7c0301ed81ee28b0ae1cc (diff)
downloaddexon-solidity-3b241843a77ed29d10355fc17383da18d979bc5b.tar
dexon-solidity-3b241843a77ed29d10355fc17383da18d979bc5b.tar.gz
dexon-solidity-3b241843a77ed29d10355fc17383da18d979bc5b.tar.bz2
dexon-solidity-3b241843a77ed29d10355fc17383da18d979bc5b.tar.lz
dexon-solidity-3b241843a77ed29d10355fc17383da18d979bc5b.tar.xz
dexon-solidity-3b241843a77ed29d10355fc17383da18d979bc5b.tar.zst
dexon-solidity-3b241843a77ed29d10355fc17383da18d979bc5b.zip
Use NameDispenser in Disambiguator
Diffstat (limited to 'libjulia/optimiser/Disambiguator.cpp')
-rw-r--r--libjulia/optimiser/Disambiguator.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/libjulia/optimiser/Disambiguator.cpp b/libjulia/optimiser/Disambiguator.cpp
index df2984e5..b988dba7 100644
--- a/libjulia/optimiser/Disambiguator.cpp
+++ b/libjulia/optimiser/Disambiguator.cpp
@@ -38,17 +38,7 @@ string Disambiguator::translateIdentifier(string const& _originalName)
Scope::Identifier const* id = m_scopes.back()->lookup(_originalName);
solAssert(id, "");
if (!m_translations.count(id))
- {
- string translated = _originalName;
- size_t suffix = 0;
- while (m_usedNames.count(translated))
- {
- suffix++;
- translated = _originalName + "_" + std::to_string(suffix);
- }
- m_usedNames.insert(translated);
- m_translations[id] = translated;
- }
+ m_translations[id] = m_nameDispenser.newName(_originalName);
return m_translations.at(id);
}