diff options
author | Kazu Hirata <kazu@google.com> | 2025-05-26 15:13:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-26 15:13:02 -0700 |
commit | 89308de4b0f4f20c685c6d9cecd6dabe117080b4 (patch) | |
tree | c228c4dc6bb19902e5d6f72dc6438a6e59f7dabe /llvm/lib/Object/ELF.cpp | |
parent | a0c33e535b1239404f0ff466e979e1f57dbf804e (diff) | |
download | llvm-89308de4b0f4f20c685c6d9cecd6dabe117080b4.zip llvm-89308de4b0f4f20c685c6d9cecd6dabe117080b4.tar.gz llvm-89308de4b0f4f20c685c6d9cecd6dabe117080b4.tar.bz2 |
[llvm] Value-initialize values with *Map::try_emplace (NFC) (#141522)
try_emplace value-initializes values, so we do not need to pass
nullptr to try_emplace when the value types are raw pointers or
std::unique_ptr<T>.
Diffstat (limited to 'llvm/lib/Object/ELF.cpp')
-rw-r--r-- | llvm/lib/Object/ELF.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp index bf42c92a..dfc8acb 100644 --- a/llvm/lib/Object/ELF.cpp +++ b/llvm/lib/Object/ELF.cpp @@ -965,8 +965,7 @@ ELFFile<ELFT>::getSectionAndRelocations( continue; } if (*DoesSectionMatch) { - if (SecToRelocMap.insert(std::make_pair(&Sec, (const Elf_Shdr *)nullptr)) - .second) + if (SecToRelocMap.try_emplace(&Sec).second) continue; } |