Fix the lookup of dictionary values by name to not do a linear search.

llvm-svn: 278286
This commit is contained in:
Greg Clayton 2016-08-10 20:37:45 +00:00
parent 7cbd6b74b4
commit 649da6d623
1 changed files with 3 additions and 8 deletions

View File

@ -542,14 +542,9 @@ public:
if (!key.empty())
{
ConstString key_cs(key);
for (collection::const_iterator iter = m_dict.begin(); iter != m_dict.end(); ++iter)
{
if (key_cs == iter->first)
{
value_sp = iter->second;
break;
}
}
collection::const_iterator iter = m_dict.find(key_cs);
if (iter != m_dict.end())
value_sp = iter->second;
}
return value_sp;
}