diff options
author | Brad King <brad.king@kitware.com> | 2020-01-17 14:38:07 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-17 14:38:45 (GMT) |
commit | 85e959b7273f3d31643dafb2208afdd4a45a3eaf (patch) | |
tree | dd979ede97544f832e9fd614a4d745fd16b80009 | |
parent | f80437ad34a34d3ba7c843dcb05fb42f603e2f7b (diff) | |
parent | 5da3d01fd18c55cf3bfbf28a376a19d6e3e53ed6 (diff) | |
download | CMake-85e959b7273f3d31643dafb2208afdd4a45a3eaf.zip CMake-85e959b7273f3d31643dafb2208afdd4a45a3eaf.tar.gz CMake-85e959b7273f3d31643dafb2208afdd4a45a3eaf.tar.bz2 |
Merge topic 'feature/cmSourceFile-avoid-unnecessary-copy'
5da3d01fd1 cmSourceFile: avoid unnnecessary copies
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4233
-rw-r--r-- | Source/cmSourceFile.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 2a345eb..60adf7f 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -128,7 +128,7 @@ bool cmSourceFile::FindFullPath(std::string* error) // The file is not generated. It must exist on disk. cmMakefile const* makefile = this->Location.GetMakefile(); // Location path - std::string const lPath = this->Location.GetFullPath(); + std::string const& lPath = this->Location.GetFullPath(); // List of extension lists std::array<std::vector<std::string> const*, 2> const extsLists = { { &makefile->GetCMakeInstance()->GetSourceExtensions(), @@ -145,7 +145,7 @@ bool cmSourceFile::FindFullPath(std::string* error) return true; } // Try full path with extension - for (auto exts : extsLists) { + for (auto& exts : extsLists) { for (std::string const& ext : *exts) { if (!ext.empty()) { std::string extPath = cmStrCat(fullPath, '.', ext); |