[clang-tools-extra] b43cfa7 - [clang-doc] Simplify code with StringMap::operator[] (NFC) (#112302)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 15 07:36:22 PDT 2024
Author: Kazu Hirata
Date: 2024-10-15T07:36:16-07:00
New Revision: b43cfa7e45dfd252dcf8de6a753558e698a216d2
URL: https://github.com/llvm/llvm-project/commit/b43cfa7e45dfd252dcf8de6a753558e698a216d2
DIFF: https://github.com/llvm/llvm-project/commit/b43cfa7e45dfd252dcf8de6a753558e698a216d2.diff
LOG: [clang-doc] Simplify code with StringMap::operator[] (NFC) (#112302)
Added:
Modified:
clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
index 04773fb8a6e721..2ce707feb3d5e2 100644
--- a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
+++ b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
@@ -300,8 +300,7 @@ Example usage for a project using a compile commands database:
llvm::StringMap<std::vector<StringRef>> USRToBitcode;
Executor->get()->getToolResults()->forEachResult(
[&](StringRef Key, StringRef Value) {
- auto R = USRToBitcode.try_emplace(Key, std::vector<StringRef>());
- R.first->second.emplace_back(Value);
+ USRToBitcode[Key].emplace_back(Value);
});
// Collects all Infos according to their unique USR value. This map is added
More information about the cfe-commits
mailing list