From db866d05deb1d345793aff4152211f7651451213 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 25 Jul 2018 12:18:49 +0200 Subject: cmLocalGenerator: Style change: Wrap temporary strings and code in braces Code style change in ``cmLocalGenerator::GetIncludeDirectories``. Embrace ``{}`` temporary strings and code that uses them to minimize their lifetime. --- Source/cmLocalGenerator.cxx | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0c50759..826ff84 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -909,9 +909,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, } // Get the target-specific include directories. - std::vector includes; - - includes = target->GetIncludeDirectories(config, lang); + std::vector includes = + target->GetIncludeDirectories(config, lang); // Support putting all the in-project include directories first if // it is requested by the project. @@ -942,17 +941,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, this->MoveSystemIncludesToEnd(dirs, config, lang, target); // Add standard include directories for this language. - // We do not filter out implicit directories here. - std::string const standardIncludesVar = - "CMAKE_" + lang + "_STANDARD_INCLUDE_DIRECTORIES"; - std::string const standardIncludes = - this->Makefile->GetSafeDefinition(standardIncludesVar); - std::vector::size_type const before = includes.size(); - cmSystemTools::ExpandListArgument(standardIncludes, includes); - for (std::vector::iterator i = includes.begin() + before; - i != includes.end(); ++i) { - cmSystemTools::ConvertToUnixSlashes(*i); - dirs.push_back(*i); + { + std::vector::size_type const before = includes.size(); + { + std::string key = "CMAKE_"; + key += lang; + key += "_STANDARD_INCLUDE_DIRECTORIES"; + std::string const value = this->Makefile->GetSafeDefinition(key); + cmSystemTools::ExpandListArgument(value, includes); + } + for (std::vector::iterator i = includes.begin() + before, + ie = includes.end(); + i != ie; ++i) { + cmSystemTools::ConvertToUnixSlashes(*i); + dirs.push_back(*i); + } } for (std::string const& i : implicitDirs) { -- cgit v0.12