diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-07-10 14:51:29 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2024-07-10 14:51:29 +0200 |
commit | 1cd7898c01b6cfcdcd0314a3d79bf8a86aa1e619 (patch) | |
tree | fbd8cb01b0203de70dee9136c45abbcf94360ccd /src/common/Logging/LogOperation.cpp | |
parent | e05d194da3d742130cd2f9eb91051610d58f8236 (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)
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; } |