diff options
author | bunnei <bunneidev@gmail.com> | 2018-10-05 10:48:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-05 10:48:58 -0400 |
commit | fe292573defea6f786d2a547a381c83622bf0a38 (patch) | |
tree | 71ade98ce5512efe08b4a31ba446217cc215fa31 | |
parent | f85f2b372807b9785bfe30b2b1e2f342d58bddf6 (diff) | |
parent | 6f168262605d7979d8069cd9dad21932a522263d (diff) |
Merge pull request #1442 from lioncash/format
text_formatter: Avoid unnecessary string temporary creation in PrintMessage()
-rw-r--r-- | src/common/logging/text_formatter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index 05437c137..6a0605c63 100644 --- a/src/common/logging/text_formatter.cpp +++ b/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); } |