Skip to content

[clang] Default-construct values with DenseMap::try_emplace (NFC) #141373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang-tools-extra/clangd/index/SymbolCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ void SymbolCollector::addRef(SymbolID ID, const SymbolRef &SR) {
}

SymbolID SymbolCollector::getSymbolIDCached(const Decl *D) {
auto It = DeclToIDCache.try_emplace(D, SymbolID{});
auto It = DeclToIDCache.try_emplace(D);
if (It.second)
It.first->second = getSymbolID(D);
return It.first->second;
Expand All @@ -1210,7 +1210,7 @@ SymbolID SymbolCollector::getSymbolIDCached(const Decl *D) {
SymbolID SymbolCollector::getSymbolIDCached(const llvm::StringRef MacroName,
const MacroInfo *MI,
const SourceManager &SM) {
auto It = MacroToIDCache.try_emplace(MI, SymbolID{});
auto It = MacroToIDCache.try_emplace(MI);
if (It.second)
It.first->second = getSymbolID(MacroName, MI, SM);
return It.first->second;
Expand Down
Loading