[clang] [clang][bytecode][NFC] Fix redundant DenseMap lookup (PR #218689)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 25 06:51:28 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/218689.diff
1 Files Affected:
- (modified) clang/lib/AST/ByteCode/Program.cpp (+1-1)
``````````diff
diff --git a/clang/lib/AST/ByteCode/Program.cpp b/clang/lib/AST/ByteCode/Program.cpp
index c838729fb599d..0acbfb7f5a419 100644
--- a/clang/lib/AST/ByteCode/Program.cpp
+++ b/clang/lib/AST/ByteCode/Program.cpp
@@ -218,7 +218,7 @@ UnsignedOrNone Program::createGlobal(const ValueDecl *VD, const Expr *Init,
// block.
auto [Iter, Inserted] = GlobalIndices.try_emplace(Redecl);
if (Inserted) {
- GlobalIndices[Redecl] = *Idx;
+ Iter->second = *Idx;
continue;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/218689
More information about the cfe-commits
mailing list