Browse Source

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

Ben Boeckel 2 years ago
parent
commit
860adec528

+ 2 - 2
Source/cmGlobalVisualStudioGenerator.h

@@ -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,

+ 2 - 2
Source/cmLocalVisualStudio7Generator.cxx

@@ -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)
   {
   }

+ 2 - 2
Source/cmVisualStudio10TargetGenerator.cxx

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

+ 5 - 5
Source/cmVisualStudioSlnData.h

@@ -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))
   {
   }