瀏覽代碼

Refactor: Eliminate redundant `operator<<` calls

Alex Turbov 1 年之前
父節點
當前提交
fc36ac6b22
共有 2 個文件被更改,包括 11 次插入11 次删除
  1. 3 3
      Source/cmMessenger.cxx
  2. 8 8
      Source/cmSystemTools.cxx

+ 3 - 3
Source/cmMessenger.cxx

@@ -80,7 +80,7 @@ void displayMessage(MessageType t, std::ostringstream& msg)
   }
 
   // Add a terminating blank line.
-  msg << "\n";
+  msg << '\n';
 
 #if !defined(CMAKE_BOOTSTRAP)
   // Add a C++ stack trace to internal errors.
@@ -90,7 +90,7 @@ void displayMessage(MessageType t, std::ostringstream& msg)
       if (cmHasLiteralPrefix(stack, "WARNING:")) {
         stack = "Note:" + stack.substr(8);
       }
-      msg << stack << "\n";
+      msg << stack << '\n';
     }
   }
 #endif
@@ -138,7 +138,7 @@ void PrintCallStack(std::ostream& out, cmListFileBacktrace bt,
     if (topSource) {
       lfc.FilePath = cmSystemTools::RelativeIfUnder(*topSource, lfc.FilePath);
     }
-    out << "  " << lfc << "\n";
+    out << "  " << lfc << '\n';
   }
 }
 

+ 8 - 8
Source/cmSystemTools.cxx

@@ -3025,10 +3025,10 @@ static cm::optional<bool> ChangeRPathELF(std::string const& file,
         std::ostringstream e;
         /* clang-format off */
         e << "The current " << se_name << " is:\n"
-          << "  " << inRPath << "\n"
-          << "which does not contain:\n"
-          << "  " << oldRPath << "\n"
-          << "as was expected.";
+             "  " << inRPath << "\n"
+             "which does not contain:\n"
+             "  " << oldRPath << "\n"
+             "as was expected.";
         /* clang-format on */
         *emsg2 = e.str();
       }
@@ -3112,10 +3112,10 @@ static cm::optional<bool> ChangeRPathXCOFF(std::string const& file,
         std::ostringstream e;
         /* clang-format off */
         e << "The current RPATH is:\n"
-          << "  " << libPath << "\n"
-          << "which does not contain:\n"
-          << "  " << oldRPath << "\n"
-          << "as was expected.";
+             "  " << libPath << "\n"
+             "which does not contain:\n"
+             "  " << oldRPath << "\n"
+             "as was expected.";
         /* clang-format on */
         *emsg = e.str();
       }