From cbba4b2059ee8c68f0e26a8783722d12b0225e80 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Mon, 1 Aug 2016 16:37:37 +0000 Subject: [PATCH] [lldb][tsan] Perform one map lookup instead of two (NFC) Differential Revision: https://reviews.llvm.org/D22983 llvm-svn: 277350 --- .../ThreadSanitizer/ThreadSanitizerRuntime.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp b/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp index 1d9fab31a0d4..a08c26fa4837 100644 --- a/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp +++ b/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp @@ -335,10 +335,11 @@ GetRenumberedThreadIds(ProcessSP process_sp, ValueObjectSP data, std::map &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