From f4a25874a2cb5468e7ecce6812e5833e10943017 Mon Sep 17 00:00:00 2001
From: Stephen Kelly <steveire@gmail.com>
Date: Mon, 6 Jul 2015 02:00:32 +0200
Subject: [PATCH] cmMakefile: Inline internal policy status method.

---
 Source/cmMakefile.cxx | 47 +++++++++++++++++--------------------------
 Source/cmMakefile.h   |  2 --
 2 files changed, 18 insertions(+), 31 deletions(-)

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index cae7bbc076..7a35a26af5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4741,34 +4741,6 @@ const char* cmMakefile::GetDefineFlagsCMP0059() const
 //----------------------------------------------------------------------------
 cmPolicies::PolicyStatus
 cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
-{
-  // Get the current setting of the policy.
-  cmPolicies::PolicyStatus cur = this->GetPolicyStatusInternal(id);
-
-  // If the policy is required to be set to NEW but is not, ignore the
-  // current setting and tell the caller.
-  if(cur != cmPolicies::NEW)
-    {
-    if(cur == cmPolicies::REQUIRED_ALWAYS ||
-       cur == cmPolicies::REQUIRED_IF_USED)
-      {
-      return cur;
-      }
-    cmPolicies::PolicyStatus def = cmPolicies::GetPolicyStatus(id);
-    if(def == cmPolicies::REQUIRED_ALWAYS ||
-       def == cmPolicies::REQUIRED_IF_USED)
-      {
-      return def;
-      }
-    }
-
-  // The current setting is okay.
-  return cur;
-}
-
-//----------------------------------------------------------------------------
-cmPolicies::PolicyStatus
-cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
 {
   cmPolicies::PolicyStatus status = cmPolicies::GetPolicyStatus(id);
   cmLocalGenerator* lg = this->LocalGenerator;
@@ -4787,7 +4759,24 @@ cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
     lg = lg->GetParent();
     }
 
-  // The policy is not set.  Use the default for this CMake version.
+  // If the policy is required to be set to NEW but is not, ignore the
+  // current setting and tell the caller.
+  if(status != cmPolicies::NEW)
+    {
+    if(status == cmPolicies::REQUIRED_ALWAYS ||
+       status == cmPolicies::REQUIRED_IF_USED)
+      {
+      return status;
+      }
+    cmPolicies::PolicyStatus def = cmPolicies::GetPolicyStatus(id);
+    if(def == cmPolicies::REQUIRED_ALWAYS ||
+       def == cmPolicies::REQUIRED_IF_USED)
+      {
+      return def;
+      }
+    }
+
+  // The current setting is okay.
   return status;
 }
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 2fc4d78a8a..6dbea89bc4 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -938,8 +938,6 @@ private:
   typedef std::vector<PolicyStackEntry> PolicyStackType;
   PolicyStackType PolicyStack;
   std::vector<PolicyStackType::size_type> PolicyBarriers;
-  cmPolicies::PolicyStatus
-  GetPolicyStatusInternal(cmPolicies::PolicyID id) const;
 
   // CMP0053 == old
   cmake::MessageType ExpandVariablesInStringOld(
-- 
GitLab