From fba67959acb7be39942aa3ce829f6764c46ad3ee Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 22 Jul 2024 10:06:07 +0200 Subject: [PATCH] QPlainTextLogger: FixedBufString: simplify appendf() qsnprintf() does not make a difference between lvalue and rvalue arguments, so the wrapper doesn't need to perfectly forward. Use decay-copy via by-value arguments to potentially reduce the number of instantiations required for the existing calls. Adjust indentation so the continuation line doesn't need to be re-indented when we'll port qsnprintf() to std::snprintf(). Amends 0e8eb20af43ca473b7a7639bb2941c9e6bad537b. Pick-to: 6.8 6.7 6.5 Change-Id: Idcaa441517fdbf00fefd952db7928731779123ab Reviewed-by: Thiago Macieira --- src/testlib/qplaintestlogger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index 58c7f6bf5be..cc757b4ad07 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -64,11 +64,11 @@ template struct FixedBufString buf[used] = '\0'; } - template void appendf(const char *format, Args &&... args) + template void appendf(const char *format, Args... args) { // vsnprintf includes the terminating null used += qsnprintf(buf.data() + used, MaxSize - used + 1, format, - std::forward(args)...); + args...); } template void appendScaled(qreal value, const char *unit)