clang-tidy: fix modernize-pass-by-value lints

This commit is contained in:
Ben Boeckel
2022-11-22 13:48:09 -05:00
parent 27e37b8a5a
commit 860adec528
4 changed files with 11 additions and 11 deletions

View File

@@ -133,8 +133,8 @@ public:
std::string First;
public:
TargetCompare(std::string const& first)
: First(first)
TargetCompare(std::string first)
: First(std::move(first))
{
}
bool operator()(cmGeneratorTarget const* l,

View File

@@ -559,10 +559,10 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranLinkFlagTable[] = {
class cmLocalVisualStudio7Generator::EventWriter
{
public:
EventWriter(cmLocalVisualStudio7Generator* lg, const std::string& config,
EventWriter(cmLocalVisualStudio7Generator* lg, std::string config,
std::ostream& os)
: LG(lg)
, Config(config)
, Config(std::move(config))
, Stream(os)
{
}

View File

@@ -80,10 +80,10 @@ struct cmVisualStudio10TargetGenerator::Elem
bool HasContent = false;
std::string Tag;
Elem(std::ostream& s, const std::string& tag)
Elem(std::ostream& s, std::string tag)
: S(s)
, Indent(0)
, Tag(tag)
, Tag(std::move(tag))
{
this->StartElement();
}

View File

@@ -14,11 +14,11 @@ class cmSlnProjectEntry
{
public:
cmSlnProjectEntry() = default;
cmSlnProjectEntry(const std::string& guid, const std::string& name,
const std::string& relativePath)
: Guid(guid)
, Name(name)
, RelativePath(relativePath)
cmSlnProjectEntry(std::string guid, std::string name,
std::string relativePath)
: Guid(std::move(guid))
, Name(std::move(name))
, RelativePath(std::move(relativePath))
{
}