From aa011746e5636e1570f19727b15c8858325b1518 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 20 Oct 2019 12:52:08 +0200 Subject: [PATCH] minor optimization in ConsoleObserverFile, if prefix is unknown then still write passed message --- src/Base/Console.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Base/Console.cpp b/src/Base/Console.cpp index f11062a2c1..9753808962 100644 --- a/src/Base/Console.cpp +++ b/src/Base/Console.cpp @@ -756,7 +756,7 @@ ConsoleObserverFile::~ConsoleObserverFile() void ConsoleObserverFile::SendLog(const std::string& msg, LogStyle level) { - std::string prefix = ""; + std::string prefix; switch(level){ case LogStyle::Warning: prefix = "Wrn: "; @@ -771,10 +771,9 @@ void ConsoleObserverFile::SendLog(const std::string& msg, LogStyle level) prefix = "Log: "; break; } - if (prefix.empty() == false){ - cFileStream << prefix << msg; - cFileStream.flush(); - } + + cFileStream << prefix << msg; + cFileStream.flush(); } ConsoleObserverStd::ConsoleObserverStd() :