From 429fb28f25752352db876f634d3b317962cfeb7d Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 6 Jul 2021 16:11:42 +0200 Subject: cmLocalGenerator: Factor out repeated condition into local variable --- Source/cmLocalGenerator.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a14f085..f58f142 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1247,9 +1247,11 @@ std::vector> cmLocalGenerator::GetIncludeDirectoriesImplicit( } } + bool const isCorCxx = (lang == "C" || lang == "CXX"); + // Checks if this is not an excluded (implicit) include directory. auto notExcluded = [this, &implicitSet, &implicitExclude, - &lang](std::string const& dir) { + isCorCxx](std::string const& dir) { return ( // Do not exclude directories that are not in an excluded set. ((!cm::contains(implicitSet, this->GlobalGenerator->GetRealPath(dir))) && @@ -1258,8 +1260,7 @@ std::vector> cmLocalGenerator::GetIncludeDirectoriesImplicit( // they are implicitly searched by the compiler. They are meant to be // user-specified directories that can be re-ordered or converted to // -isystem without breaking real compiler builtin headers. - || - ((lang == "C" || lang == "CXX") && cm::contains(this->EnvCPATH, dir))); + || (isCorCxx && cm::contains(this->EnvCPATH, dir))); }; // Get the target-specific include directories. -- cgit v0.12