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 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits