From 687aef913c471bcbd105f49bec8bcdf976ce7eb5 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Sat, 26 Aug 2017 14:06:09 +0200 Subject: cmSourceFile: Avoid unnecessary vector copy --- Source/cmSourceFile.cxx | 8 ++++---- 1 file 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& srcExts = - mf->GetCMakeInstance()->GetSourceExtensions(); - std::vector hdrExts = - mf->GetCMakeInstance()->GetHeaderExtensions(); + + cmake const* const cmakeInst = mf->GetCMakeInstance(); + std::vector const& srcExts = cmakeInst->GetSourceExtensions(); + std::vector const& hdrExts = cmakeInst->GetHeaderExtensions(); for (const char* const* di = tryDirs; *di; ++di) { std::string tryPath = this->Location.GetDirectory(); if (!tryPath.empty()) { -- cgit v0.12