[clang] [Basic] Avoid repeated hash lookups (NFC) (PR #111228)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 5 09:57:49 PDT 2024
================
@@ -92,11 +92,10 @@ parseTargetIDWithFormatCheckingOnly(llvm::StringRef TargetID,
if (Sign != '+' && Sign != '-')
return std::nullopt;
bool IsOn = Sign == '+';
- auto Loc = FeatureMap->find(Feature);
+ auto [Loc, Inserted] = FeatureMap->try_emplace(Feature, IsOn);
----------------
kazutakahirata wrote:
Thank you for pointing this out!
https://github.com/llvm/llvm-project/pull/111228
More information about the cfe-commits
mailing list