[all-commits] [llvm/llvm-project] 577585: [llvm] Use *Map::try_emplace (NFC) (#149257)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Thu Jul 17 07:23:30 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 577585198637fc2ced2a4fdf20f91c58fb74c717
      https://github.com/llvm/llvm-project/commit/577585198637fc2ced2a4fdf20f91c58fb74c717
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-07-17 (Thu, 17 Jul 2025)

  Changed paths:
    M llvm/include/llvm/ADT/EquivalenceClasses.h
    M llvm/lib/MC/MCContext.cpp

  Log Message:
  -----------
  [llvm] Use *Map::try_emplace (NFC) (#149257)

- try_emplace(Key) is shorter than insert({Key, nullptr}).
- try_emplace performs value initialization without value parameters.
- We overwrite values on successful insertion anyway.

While we are at it, this patch simplifies the code with structured
binding.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list