[clang-tools-extra] 1c502c6 - [clang-doc] SerializeIndex - pass Index param by constant reference
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 17 05:28:21 PST 2022
Author: Simon Pilgrim
Date: 2022-02-17T13:28:02Z
New Revision: 1c502c63cb77dd15e698087fdc6b3fb892ce0977
URL: https://github.com/llvm/llvm-project/commit/1c502c63cb77dd15e698087fdc6b3fb892ce0977
DIFF: https://github.com/llvm/llvm-project/commit/1c502c63cb77dd15e698087fdc6b3fb892ce0977.diff
LOG: [clang-doc] SerializeIndex - pass Index param by constant reference
Silence coverity warnings about unnecessary copies
Added:
Modified:
clang-tools-extra/clang-doc/HTMLGenerator.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-doc/HTMLGenerator.cpp b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
index e110f312d10c4..4ab962be7864d 100644
--- a/clang-tools-extra/clang-doc/HTMLGenerator.cpp
+++ b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
@@ -899,7 +899,7 @@ static llvm::Error SerializeIndex(ClangDocContext &CDCtx) {
}
CDCtx.Idx.sort();
llvm::json::OStream J(OS, 2);
- std::function<void(Index)> IndexToJSON = [&](Index I) {
+ std::function<void(Index)> IndexToJSON = [&](const Index &I) {
J.object([&] {
J.attribute("USR", toHex(llvm::toStringRef(I.USR)));
J.attribute("Name", I.Name);
More information about the cfe-commits
mailing list