From 6d2aa54d620a6526cc23e59b30ee0191d61ac59d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 22 Nov 2022 13:59:50 -0500 Subject: clang-tidy: fix `performance-unnecessary-copy-initialization` lints --- Source/cmGlobalVisualStudio7Generator.cxx | 4 ++-- Source/cmVisualStudio10TargetGenerator.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index d7bf106..ed1f333 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -426,7 +426,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( cmValue expath = target->GetProperty("EXTERNAL_MSPROJECT"); if (expath) { std::string project = target->GetName(); - std::string location = *expath; + std::string const& location = *expath; this->WriteExternalProject(fout, project, location, target->GetProperty("VS_PROJECT_TYPE"), @@ -506,7 +506,7 @@ void cmGlobalVisualStudio7Generator::WriteFoldersContent(std::ostream& fout) std::string guidParent(this->GetGUID(key)); for (std::string const& it : iter.second) { - std::string value(it); + std::string const& value(it); std::string guid(this->GetGUID(value)); fout << "\t\t{" << guid << "} = {" << guidParent << "}\n"; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 753a532..07adce0 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -424,7 +424,7 @@ void cmVisualStudio10TargetGenerator::Generate() cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(), '/', this->Name, ProjectFileExtension); cmGeneratedFileStream BuildFileStream(path); - const std::string PathToProjectFile = path; + const std::string& PathToProjectFile = path; BuildFileStream.SetCopyIfDifferent(true); // Write the encoding header into the file -- cgit v0.12