[Lldb-commits] [lldb] r277350 - [lldb][tsan] Perform one map lookup instead of two (NFC)

Vedant Kumar via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 1 09:37:38 PDT 2016


Author: vedantk
Date: Mon Aug  1 11:37:37 2016
New Revision: 277350

URL: http://llvm.org/viewvc/llvm-project?rev=277350&view=rev
Log:
[lldb][tsan] Perform one map lookup instead of two (NFC)

Differential Revision: https://reviews.llvm.org/D22983

Modified:
    lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp

Modified: lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp?rev=277350&r1=277349&r2=277350&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp Mon Aug  1 11:37:37 2016
@@ -335,10 +335,11 @@ GetRenumberedThreadIds(ProcessSP process
 }
 
 static user_id_t Renumber(uint64_t id, std::map<uint64_t, user_id_t> &thread_id_map) {
-    if (! thread_id_map.count(id))
+    auto IT = thread_id_map.find(id);
+    if (IT == thread_id_map.end())
         return 0;
     
-    return thread_id_map[id];
+    return IT->second;
 }
 
 StructuredData::ObjectSP




More information about the lldb-commits mailing list