Skip to content

Commit 0c9139b

Browse files
kazutakahiratasivan-shani
authored andcommitted
[clang] Default-construct values with DenseMap::try_emplace (NFC) (llvm#141373)
try_emplace can default-construct values, so we do not need to do so on our own.
1 parent 0067503 commit 0c9139b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang-tools-extra/clangd/index/SymbolCollector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ void SymbolCollector::addRef(SymbolID ID, const SymbolRef &SR) {
12011201
}
12021202

12031203
SymbolID SymbolCollector::getSymbolIDCached(const Decl *D) {
1204-
auto It = DeclToIDCache.try_emplace(D, SymbolID{});
1204+
auto It = DeclToIDCache.try_emplace(D);
12051205
if (It.second)
12061206
It.first->second = getSymbolID(D);
12071207
return It.first->second;
@@ -1210,7 +1210,7 @@ SymbolID SymbolCollector::getSymbolIDCached(const Decl *D) {
12101210
SymbolID SymbolCollector::getSymbolIDCached(const llvm::StringRef MacroName,
12111211
const MacroInfo *MI,
12121212
const SourceManager &SM) {
1213-
auto It = MacroToIDCache.try_emplace(MI, SymbolID{});
1213+
auto It = MacroToIDCache.try_emplace(MI);
12141214
if (It.second)
12151215
It.first->second = getSymbolID(MacroName, MI, SM);
12161216
return It.first->second;

0 commit comments

Comments
 (0)