[clang-doc] SerializeIndex - pass Index param by constant reference

Silence coverity warnings about unnecessary copies
This commit is contained in:
Simon Pilgrim
2022-02-17 13:28:02 +00:00
parent f29f86b60b
commit 1c502c63cb

View File

@@ -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);