[clang] [Sema] Avoid repeated hash lookups (NFC) (PR #110951)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 2 20:16:06 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/110951.diff
1 Files Affected:
- (modified) clang/lib/Sema/JumpDiagnostics.cpp (+1-2)
``````````diff
diff --git a/clang/lib/Sema/JumpDiagnostics.cpp b/clang/lib/Sema/JumpDiagnostics.cpp
index 8af36d5c24e3d2..00fdffca4e9ea9 100644
--- a/clang/lib/Sema/JumpDiagnostics.cpp
+++ b/clang/lib/Sema/JumpDiagnostics.cpp
@@ -761,8 +761,7 @@ void JumpScopeChecker::VerifyIndirectJumps() {
if (CHECK_PERMISSIVE(!LabelAndGotoScopes.count(IG)))
continue;
unsigned IGScope = LabelAndGotoScopes[IG];
- if (!JumpScopesMap.contains(IGScope))
- JumpScopesMap[IGScope] = IG;
+ JumpScopesMap.try_emplace(IGScope, IG);
}
JumpScopes.reserve(JumpScopesMap.size());
for (auto &Pair : JumpScopesMap)
``````````
</details>
https://github.com/llvm/llvm-project/pull/110951
More information about the cfe-commits
mailing list