Author: Kazu Hirata Date: 2024-10-03T08:29:04-07:00 New Revision: 66f846d753be6ac62f613bd98ca791050ba3c4a5
URL: https://github.com/llvm/llvm-project/commit/66f846d753be6ac62f613bd98ca791050ba3c4a5 DIFF: https://github.com/llvm/llvm-project/commit/66f846d753be6ac62f613bd98ca791050ba3c4a5.diff LOG: [Sema] Avoid repeated hash lookups (NFC) (#110951) Added: Modified: clang/lib/Sema/JumpDiagnostics.cpp Removed: ################################################################################ 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) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits