[PATCH] D22983: [lldb][tsan] Perform one map lookup instead of two (NFC)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 09:15:53 PDT 2016


LGTM

On Fri, Jul 29, 2016 at 5:12 PM Vedant Kumar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> vsk created this revision.
> vsk added a reviewer: kubabrecka.
> vsk added a subscriber: llvm-commits.
>
> https://reviews.llvm.org/D22983
>
> Files:
>
> source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
>
> Index:
> source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
> ===================================================================
> ---
> source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
> +++
> source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
> @@ -335,10 +335,11 @@
>  }
>
>  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
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160801/2818d017/attachment-0001.html>


More information about the llvm-commits mailing list