Преглед изворни кода

Merge pull request #1442 from lioncash/format

text_formatter: Avoid unnecessary string temporary creation in PrintMessage()
bunnei пре 7 година
родитељ
комит
fe292573de
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/common/logging/text_formatter.cpp

+ 1 - 1
src/common/logging/text_formatter.cpp

@@ -31,7 +31,7 @@ std::string FormatLogMessage(const Entry& entry) {
 }
 
 void PrintMessage(const Entry& entry) {
-    auto str = FormatLogMessage(entry) + '\n';
+    const auto str = FormatLogMessage(entry).append(1, '\n');
     fputs(str.c_str(), stderr);
 }