diff options
author | Kazu Hirata <kazu@google.com> | 2025-05-19 06:19:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-19 06:19:53 -0700 |
commit | 325281631a3b5c089dd732d9ca10704431447859 (patch) | |
tree | 70f320dbff2eceda05a6ec970e5363e9f959117b /clang/lib/Basic/SourceManager.cpp | |
parent | 2a277f9ff1c793e25167537b0202f333f8f91f60 (diff) | |
download | llvm-325281631a3b5c089dd732d9ca10704431447859.zip llvm-325281631a3b5c089dd732d9ca10704431447859.tar.gz llvm-325281631a3b5c089dd732d9ca10704431447859.tar.bz2 |
[clang] Use *Map::try_emplace (NFC) (#140477)
We can simplify the code with *Map::try_emplace where we need
default-constructed values while avoding calling constructors when
keys are already present.
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 6d6e54b..4028bbf 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -1726,7 +1726,7 @@ void SourceManager::computeMacroArgsCache(MacroArgsMap &MacroArgsCache, assert(FID.isValid()); // Initially no macro argument chunk is present. - MacroArgsCache.insert(std::make_pair(0, SourceLocation())); + MacroArgsCache.try_emplace(0); int ID = FID.ID; while (true) { |