Skip to content

Commit b43cfa7

Browse files
[clang-doc] Simplify code with StringMap::operator[] (NFC) (llvm#112302)
1 parent 3c2e1d3 commit b43cfa7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang-tools-extra/clang-doc/tool/ClangDocMain.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ Example usage for a project using a compile commands database:
300300
llvm::StringMap<std::vector<StringRef>> USRToBitcode;
301301
Executor->get()->getToolResults()->forEachResult(
302302
[&](StringRef Key, StringRef Value) {
303-
auto R = USRToBitcode.try_emplace(Key, std::vector<StringRef>());
304-
R.first->second.emplace_back(Value);
303+
USRToBitcode[Key].emplace_back(Value);
305304
});
306305

307306
// Collects all Infos according to their unique USR value. This map is added

0 commit comments

Comments
 (0)