From 649da6d623aadd813e948f2b501333efcf7f9927 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 10 Aug 2016 20:37:45 +0000 Subject: [PATCH] Fix the lookup of dictionary values by name to not do a linear search. llvm-svn: 278286 --- lldb/include/lldb/Core/StructuredData.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lldb/include/lldb/Core/StructuredData.h b/lldb/include/lldb/Core/StructuredData.h index 28fb80f..b581655 100644 --- a/lldb/include/lldb/Core/StructuredData.h +++ b/lldb/include/lldb/Core/StructuredData.h @@ -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; } -- 2.7.4