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 <thiago.macieira@intel.com>
This commit is contained in:
parent
a90a1ebac8
commit
fba67959ac
@ -64,11 +64,11 @@ template <int N> struct FixedBufString
|
||||
buf[used] = '\0';
|
||||
}
|
||||
|
||||
template <typename... Args> void appendf(const char *format, Args &&... args)
|
||||
template <typename... Args> 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)...);
|
||||
args...);
|
||||
}
|
||||
|
||||
template <int Power = 1000> void appendScaled(qreal value, const char *unit)
|
||||
|
Loading…
x
Reference in New Issue
Block a user