forked from OSchip/llvm-project
Fix the lookup of dictionary values by name to not do a linear search.
llvm-svn: 278286
This commit is contained in:
parent
7cbd6b74b4
commit
649da6d623
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue