mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Fix some occurrences using string by value rather than by const&
Fix issues diagnosed by clang-tidy - performance-unnecessary-value-param - performance-unnecessary-copy-initialization Signed-off-by: Matthias Maennich <matthias@maennich.net>
This commit is contained in:
committed by
Brad King
parent
8cc33aeaec
commit
bb0ad1bea8
@@ -769,7 +769,8 @@ std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix(
|
||||
|
||||
bool cmCPackDragNDropGenerator::WriteLicense(
|
||||
cmGeneratedFileStream& outputStream, int licenseNumber,
|
||||
std::string licenseLanguage, std::string licenseFile, std::string* error)
|
||||
std::string licenseLanguage, const std::string& licenseFile,
|
||||
std::string* error)
|
||||
{
|
||||
if (!licenseFile.empty() && !singleLicense) {
|
||||
licenseNumber = 5002;
|
||||
|
||||
@@ -45,8 +45,8 @@ private:
|
||||
bool singleLicense;
|
||||
|
||||
bool WriteLicense(cmGeneratedFileStream& outputStream, int licenseNumber,
|
||||
std::string licenseLanguage, std::string licenseFile,
|
||||
std::string* error);
|
||||
std::string licenseLanguage,
|
||||
const std::string& licenseFile, std::string* error);
|
||||
bool BreakLongLine(const std::string& line, std::vector<std::string>& lines,
|
||||
std::string* error);
|
||||
void EscapeQuotesAndBackslashes(std::string& line);
|
||||
|
||||
@@ -573,7 +573,7 @@ void cmGlobalXCodeGenerator::ClearXCodeObjects()
|
||||
void cmGlobalXCodeGenerator::addObject(cmXCodeObject* obj)
|
||||
{
|
||||
if (obj->GetType() == cmXCodeObject::OBJECT) {
|
||||
std::string id = obj->GetId();
|
||||
const std::string& id = obj->GetId();
|
||||
|
||||
// If this is a duplicate id, it's an error:
|
||||
//
|
||||
@@ -2748,7 +2748,7 @@ bool cmGlobalXCodeGenerator::CreateGroups(
|
||||
}
|
||||
|
||||
cmXCodeObject* cmGlobalXCodeGenerator::CreatePBXGroup(cmXCodeObject* parent,
|
||||
std::string name)
|
||||
const std::string& name)
|
||||
{
|
||||
cmXCodeObject* parentChildren = nullptr;
|
||||
if (parent)
|
||||
|
||||
@@ -106,7 +106,8 @@ protected:
|
||||
private:
|
||||
cmXCodeObject* CreateOrGetPBXGroup(cmGeneratorTarget* gtgt,
|
||||
cmSourceGroup* sg);
|
||||
cmXCodeObject* CreatePBXGroup(cmXCodeObject* parent, std::string name);
|
||||
cmXCodeObject* CreatePBXGroup(cmXCodeObject* parent,
|
||||
const std::string& name);
|
||||
bool CreateGroups(std::vector<cmLocalGenerator*>& generators);
|
||||
std::string XCodeEscapePath(const std::string& p);
|
||||
std::string RelativeToSource(const char* p);
|
||||
|
||||
@@ -130,7 +130,7 @@ void cmXCodeObject::Print(std::ostream& out)
|
||||
}
|
||||
|
||||
void cmXCodeObject::PrintAttribute(std::ostream& out, const int level,
|
||||
const std::string separator,
|
||||
const std::string& separator,
|
||||
const int factor, const std::string& name,
|
||||
const cmXCodeObject* object,
|
||||
const cmXCodeObject* parent)
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
static void Indent(int level, std::ostream& out);
|
||||
void Print(std::ostream& out);
|
||||
void PrintAttribute(std::ostream& out, const int level,
|
||||
const std::string separator, const int factor,
|
||||
const std::string& separator, const int factor,
|
||||
const std::string& name, const cmXCodeObject* object,
|
||||
const cmXCodeObject* parent);
|
||||
virtual void PrintComment(std::ostream&) {}
|
||||
|
||||
@@ -91,7 +91,7 @@ void cmXCodeScheme::WriteBuildAction(cmXMLWriter& xout,
|
||||
}
|
||||
|
||||
void cmXCodeScheme::WriteTestAction(cmXMLWriter& xout,
|
||||
std::string configuration,
|
||||
const std::string& configuration,
|
||||
const std::string& container)
|
||||
{
|
||||
xout.StartElement("TestAction");
|
||||
@@ -127,7 +127,7 @@ void cmXCodeScheme::WriteTestAction(cmXMLWriter& xout,
|
||||
}
|
||||
|
||||
void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
|
||||
std::string configuration,
|
||||
const std::string& configuration,
|
||||
const std::string& container)
|
||||
{
|
||||
xout.StartElement("LaunchAction");
|
||||
@@ -164,7 +164,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
|
||||
}
|
||||
|
||||
void cmXCodeScheme::WriteProfileAction(cmXMLWriter& xout,
|
||||
std::string configuration)
|
||||
const std::string& configuration)
|
||||
{
|
||||
xout.StartElement("ProfileAction");
|
||||
xout.BreakAttributes();
|
||||
@@ -177,7 +177,7 @@ void cmXCodeScheme::WriteProfileAction(cmXMLWriter& xout,
|
||||
}
|
||||
|
||||
void cmXCodeScheme::WriteAnalyzeAction(cmXMLWriter& xout,
|
||||
std::string configuration)
|
||||
const std::string& configuration)
|
||||
{
|
||||
xout.StartElement("AnalyzeAction");
|
||||
xout.BreakAttributes();
|
||||
@@ -186,7 +186,7 @@ void cmXCodeScheme::WriteAnalyzeAction(cmXMLWriter& xout,
|
||||
}
|
||||
|
||||
void cmXCodeScheme::WriteArchiveAction(cmXMLWriter& xout,
|
||||
std::string configuration)
|
||||
const std::string& configuration)
|
||||
{
|
||||
xout.StartElement("ArchiveAction");
|
||||
xout.BreakAttributes();
|
||||
|
||||
@@ -37,13 +37,13 @@ private:
|
||||
void WriteXCodeXCScheme(std::ostream& fout, const std::string& container);
|
||||
|
||||
void WriteBuildAction(cmXMLWriter& xout, const std::string& container);
|
||||
void WriteTestAction(cmXMLWriter& xout, std::string configuration,
|
||||
void WriteTestAction(cmXMLWriter& xout, const std::string& configuration,
|
||||
const std::string& container);
|
||||
void WriteLaunchAction(cmXMLWriter& xout, std::string configuration,
|
||||
void WriteLaunchAction(cmXMLWriter& xout, const std::string& configuration,
|
||||
const std::string& container);
|
||||
void WriteProfileAction(cmXMLWriter& xout, std::string configuration);
|
||||
void WriteAnalyzeAction(cmXMLWriter& xout, std::string configuration);
|
||||
void WriteArchiveAction(cmXMLWriter& xout, std::string configuration);
|
||||
void WriteProfileAction(cmXMLWriter& xout, const std::string& configuration);
|
||||
void WriteAnalyzeAction(cmXMLWriter& xout, const std::string& configuration);
|
||||
void WriteArchiveAction(cmXMLWriter& xout, const std::string& configuration);
|
||||
|
||||
void WriteBuildableReference(cmXMLWriter& xout, const cmXCodeObject* xcObj,
|
||||
const std::string& container);
|
||||
|
||||
Reference in New Issue
Block a user