summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-08-27 07:51:54 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-08-27 07:52:47 (GMT)
commit19f2a706a3d0ca72f0c6151bbfcd3b944c14e72b (patch)
tree4c829d54b58319a4a070667c34e97e7aff654793
parentb044dedecd372bf87c892d81b7e5c1e9aad9c9ed (diff)
parent687aef913c471bcbd105f49bec8bcdf976ce7eb5 (diff)
downloadCMake-19f2a706a3d0ca72f0c6151bbfcd3b944c14e72b.zip
CMake-19f2a706a3d0ca72f0c6151bbfcd3b944c14e72b.tar.gz
CMake-19f2a706a3d0ca72f0c6151bbfcd3b944c14e72b.tar.bz2
Merge topic 'cmSourceFile-Nocopy'
687aef91 cmSourceFile: Avoid unnecessary vector copy Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1190
-rw-r--r--Source/cmSourceFile.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 912f773..6d2b98d 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -136,10 +136,10 @@ bool cmSourceFile::FindFullPath(std::string* error)
} else {
tryDirs[0] = "";
}
- const std::vector<std::string>& srcExts =
- mf->GetCMakeInstance()->GetSourceExtensions();
- std::vector<std::string> hdrExts =
- mf->GetCMakeInstance()->GetHeaderExtensions();
+
+ cmake const* const cmakeInst = mf->GetCMakeInstance();
+ std::vector<std::string> const& srcExts = cmakeInst->GetSourceExtensions();
+ std::vector<std::string> const& hdrExts = cmakeInst->GetHeaderExtensions();
for (const char* const* di = tryDirs; *di; ++di) {
std::string tryPath = this->Location.GetDirectory();
if (!tryPath.empty()) {