From 8b14bc974dbc2ad9b09d5177fad5ec736a1ddf4a Mon Sep 17 00:00:00 2001 From: Albin Johansson Date: Sat, 18 May 2024 20:27:42 +0200 Subject: [PATCH] Pass format arguments as reference-to-const --- source/core/inc/tactile/core/log/logger.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/core/inc/tactile/core/log/logger.hpp b/source/core/inc/tactile/core/log/logger.hpp index 8620188da8..34ffbe0600 100644 --- a/source/core/inc/tactile/core/log/logger.hpp +++ b/source/core/inc/tactile/core/log/logger.hpp @@ -2,8 +2,7 @@ #pragma once -#include // format_string, make_format_args, format_args -#include // forward +#include // format_string, make_format_args, format_args #include "tactile/base/container/maybe.hpp" #include "tactile/base/container/smart_ptr.hpp" @@ -70,9 +69,9 @@ class Logger final template void log(const LogLevel level, const std::format_string fmt, - Args&&... args) noexcept + const Args&... args) noexcept { - _log(level, fmt.get(), std::make_format_args(std::forward(args)...)); + _log(level, fmt.get(), std::make_format_args(args...)); } /** @@ -157,7 +156,7 @@ class Logger final LogLevel mFlushLevel {LogLevel::kError}; Vector> mSinks {}; Maybe mReferenceInstant {}; - StringView mScope {""}; + StringView mScope {}; void _log(LogLevel level, StringView fmt_string,