Performance: Simple upgrade/cleanup of stl c++11 containers (10% perf. increase).

This commit is contained in:
John Kessenich 2015-07-18 22:34:27 -06:00
parent f4673162b7
commit 2f273369e4
10 changed files with 58 additions and 54 deletions

View file

@ -130,7 +130,7 @@ namespace glslang {
//
int TPpContext::LookUpAddString(const char* s)
{
TAtomMap::const_iterator it = atomMap.find(s);
auto it = atomMap.find(s);
if (it == atomMap.end())
return AddAtomFixed(s, nextAtom++);
else
@ -161,7 +161,7 @@ const char* TPpContext::GetAtomString(int atom)
//
int TPpContext::AddAtomFixed(const char* s, int atom)
{
TAtomMap::const_iterator it = atomMap.insert(std::pair<TString, int>(s, atom)).first;
auto it = atomMap.insert(std::pair<TString, int>(s, atom)).first;
if (stringMap.size() < (size_t)atom + 1)
stringMap.resize(atom + 100, 0);
stringMap[atom] = &it->first;