[llvm] [BOLT] Use DenseMap::contains (NFC) (PR #167169)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 8 11:00:22 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-bolt
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
Identified with readability-container-contains.
---
Full diff: https://github.com/llvm/llvm-project/pull/167169.diff
1 Files Affected:
- (modified) bolt/lib/Core/DebugNames.cpp (+1-1)
``````````diff
diff --git a/bolt/lib/Core/DebugNames.cpp b/bolt/lib/Core/DebugNames.cpp
index 6be2c5aa4e6c1..5272d402be7f3 100644
--- a/bolt/lib/Core/DebugNames.cpp
+++ b/bolt/lib/Core/DebugNames.cpp
@@ -555,7 +555,7 @@ void DWARF5AcceleratorTable::populateAbbrevsMap() {
void DWARF5AcceleratorTable::writeEntry(BOLTDWARF5AccelTableData &Entry) {
const uint64_t EntryID = getEntryID(Entry);
- if (EntryRelativeOffsets.find(EntryID) != EntryRelativeOffsets.end())
+ if (EntryRelativeOffsets.contains(EntryID))
EntryRelativeOffsets[EntryID] = EntriesBuffer->size();
const std::optional<DWARF5AccelTable::UnitIndexAndEncoding> EntryRet =
``````````
</details>
https://github.com/llvm/llvm-project/pull/167169
More information about the llvm-commits
mailing list