diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-07-10 14:51:29 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-07-11 19:06:51 +0200 |
commit | 4c4f5f0ae4c7ad01d846b62051959b2cab16f306 (patch) | |
tree | 6d08f61c95fe3d480dcb785e8bbd6495ffb9fc51 /src/common/Logging/LogOperation.cpp | |
parent | a638c3690547e17c129abf2737c8ed6b0732a55f (diff) |
Core/Logging: Removed one layer of allocations from log message writes (async doesn't wrap in shared_ptr anymore and sync creates LogMessage on the stack)
(cherry picked from commit 1cd7898c01b6cfcdcd0314a3d79bf8a86aa1e619)
Diffstat (limited to 'src/common/Logging/LogOperation.cpp')
-rw-r--r-- | src/common/Logging/LogOperation.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/common/Logging/LogOperation.cpp b/src/common/Logging/LogOperation.cpp index 8370c075ed7..4a1bad6ff41 100644 --- a/src/common/Logging/LogOperation.cpp +++ b/src/common/Logging/LogOperation.cpp @@ -16,19 +16,16 @@ */ #include "LogOperation.h" -#include "Logger.h" #include "LogMessage.h" +#include "Logger.h" -LogOperation::LogOperation(Logger const* _logger, std::unique_ptr<LogMessage>&& _msg) : logger(_logger), msg(std::forward<std::unique_ptr<LogMessage>>(_msg)) +LogOperation::LogOperation(Logger const* _logger, LogMessage* _msg) : logger(_logger), msg(_msg) { } -LogOperation::~LogOperation() -{ -} +LogOperation::~LogOperation() = default; -int LogOperation::call() +void LogOperation::operator()() const { logger->write(msg.get()); - return 0; } |