Browse Source

cmMessageCommand: Remove extra layer of parentheses

The logic checking `CMAKE_WARN_DEPRECATED` contained an unnecessary
layer of parentheses.  The condition is of the form `!IsSet || IsOn`
which is correct because the documentation says that the behavior is
enabled unless the variable is explicitly set to a false value.

Issue: #19610
Brad King 6 năm trước cách đây
mục cha
commit
51565abe79
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      Source/cmMessageCommand.cxx

+ 2 - 2
Source/cmMessageCommand.cxx

@@ -70,8 +70,8 @@ bool cmMessageCommand(std::vector<std::string> const& args,
       fatal = true;
       type = MessageType::DEPRECATION_ERROR;
       level = cmake::LogLevel::LOG_ERROR;
-    } else if ((!status.GetMakefile().IsSet("CMAKE_WARN_DEPRECATED") ||
-                status.GetMakefile().IsOn("CMAKE_WARN_DEPRECATED"))) {
+    } else if (!status.GetMakefile().IsSet("CMAKE_WARN_DEPRECATED") ||
+               status.GetMakefile().IsOn("CMAKE_WARN_DEPRECATED")) {
       type = MessageType::DEPRECATION_WARNING;
       level = cmake::LogLevel::LOG_WARNING;
     } else {