summaryrefslogtreecommitdiff
path: root/Source/cmFileCopier.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-08-03 13:20:31 +0200
committerSebastian Holtermann <sebholt@xwmw.org>2019-08-05 17:21:00 +0200
commit18b0330b86cae2771a54021e390f157a097c8a99 (patch)
tree85b770ff9467bdc764d7b42ed2480016c26b2235 /Source/cmFileCopier.cxx
parent2327cc0e0575175e8dec4b7a6fa6cafd5d0f7ca9 (diff)
downloadcmake-18b0330b86cae2771a54021e390f157a097c8a99.tar.gz
clang-tidy: Enable performance-inefficient-string-concatenation
Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
Diffstat (limited to 'Source/cmFileCopier.cxx')
-rw-r--r--Source/cmFileCopier.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx
index 4f1a1581e3..71493bb861 100644
--- a/Source/cmFileCopier.cxx
+++ b/Source/cmFileCopier.cxx
@@ -7,6 +7,7 @@
#include "cmFileCommand.h"
#include "cmFileTimes.h"
#include "cmMakefile.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmsys/Directory.hxx"
#include "cmsys/Glob.hxx"
@@ -490,7 +491,7 @@ bool cmFileCopier::InstallSymlinkChain(std::string& fromFile,
while (cmSystemTools::ReadSymlink(fromFile, newFromFile)) {
if (!cmSystemTools::FileIsFullPath(newFromFile)) {
std::string fromFilePath = cmSystemTools::GetFilenamePath(fromFile);
- newFromFile = fromFilePath + "/" + newFromFile;
+ newFromFile = cmStrCat(fromFilePath, "/", newFromFile);
}
std::string symlinkTarget = cmSystemTools::GetFilenameName(newFromFile);
@@ -520,7 +521,7 @@ bool cmFileCopier::InstallSymlinkChain(std::string& fromFile,
}
fromFile = newFromFile;
- toFile = toFilePath + "/" + symlinkTarget;
+ toFile = cmStrCat(toFilePath, "/", symlinkTarget);
}
return true;