[cmake-developers] [PATCH 2/3] Pass string by const& instead of copying

Levermann, Simon Simon.Levermann at governikus.de
Tue Nov 3 06:09:05 EST 2015


From: Simon Levermann <Simon.Levermann at governikus.de>

---
 Source/CPack/cmCPackDragNDropGenerator.cxx | 2 +-
 Source/CPack/cmCPackDragNDropGenerator.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index cdcda64..ccda0d5 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -843,7 +843,7 @@ cmCPackDragNDropGenerator::WriteLicense(cmGeneratedFileStream& outputStream, int
 }
 
 void
-cmCPackDragNDropGenerator::BreakLongLine(std::string line, std::vector<std::string>& lines)
+cmCPackDragNDropGenerator::BreakLongLine(const std::string& line, std::vector<std::string>& lines)
 {
   const size_t max_line_length = 512;
   for(size_t i = 0; i < line.size(); i += max_line_length)
diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h
index 9fb39a4..65b64ef 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.h
+++ b/Source/CPack/cmCPackDragNDropGenerator.h
@@ -48,7 +48,7 @@ private:
   std::string slaDirectory;
 
   void WriteLicense(cmGeneratedFileStream& outputStream, int licenseNumber, std::string licenseLanguage, std::string licenseFile = "");
-  void BreakLongLine(std::string line, std::vector<std::string>& lines);
+  void BreakLongLine(const std::string& line, std::vector<std::string>& lines);
   void EscapeQuotes(std::string& line);
 };
 
-- 
2.1.4


More information about the cmake-developers mailing list