浏览代码

message(): Minor code modernization

Alex Turbov 6 年之前
父节点
当前提交
599587feb1
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      Source/cmMessageCommand.cxx

+ 5 - 5
Source/cmMessageCommand.cxx

@@ -22,11 +22,11 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
     this->SetError("called with incorrect number of arguments");
     return false;
   }
-  std::vector<std::string>::const_iterator i = args.begin();
+  auto i = args.cbegin();
 
-  MessageType type = MessageType::MESSAGE;
-  bool status = false;
-  bool fatal = false;
+  auto type = MessageType::MESSAGE;
+  auto status = false;
+  auto fatal = false;
   auto level = cmake::LogLevel::LOG_UNDEFINED;
   if (*i == "SEND_ERROR") {
     type = MessageType::FATAL_ERROR;
@@ -103,7 +103,7 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
     return true;
   }
 
-  std::string message = cmJoin(cmMakeRange(i, args.end()), std::string());
+  auto message = cmJoin(cmMakeRange(i, args.cend()), "");
 
   if (type != MessageType::MESSAGE) {
     // we've overridden the message type, above, so display it directly