浏览代码

cmMakefile: Remove pointless condition

This method is never called with an empty string.
Stephen Kelly 9 年之前
父节点
当前提交
267e02097e
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      Source/cmMakefile.cxx

+ 2 - 4
Source/cmMakefile.cxx

@@ -3970,10 +3970,8 @@ cmPolicies::PolicyStatus cmMakefile::GetPolicyStatus(
 bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var)
 {
   // Check for an explicit CMAKE_POLICY_WARNING_CMP<NNNN> setting.
-  if (!var.empty()) {
-    if (const char* val = this->GetDefinition(var)) {
-      return cmSystemTools::IsOn(val);
-    }
+  if (const char* val = this->GetDefinition(var)) {
+    return cmSystemTools::IsOn(val);
   }
   // Enable optional policy warnings with --debug-output, --trace,
   // or --trace-expand.