summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-08-26 12:06:09 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-08-26 12:45:46 (GMT)
commit687aef913c471bcbd105f49bec8bcdf976ce7eb5 (patch)
treee40dec6b3593232bd38c1cd30625c0771ec068f8
parent6285fe009dbdaee4442fc4d6d8b13352f6bf5509 (diff)
downloadCMake-687aef913c471bcbd105f49bec8bcdf976ce7eb5.zip
CMake-687aef913c471bcbd105f49bec8bcdf976ce7eb5.tar.gz
CMake-687aef913c471bcbd105f49bec8bcdf976ce7eb5.tar.bz2
cmSourceFile: Avoid unnecessary vector copy
-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()) {