From a6bca753c9d7167088839b0fd047df9e7eb6ed35 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 27 Dec 2021 10:37:44 +0100 Subject: [PATCH] QLocale: replace use of append(QString(n, c)) with resize(size() + n, c) Avoids a temporary QString creation. Change-Id: Ibc87a3f1bf2979780e4a2cce7e1757f97c39a9be Reviewed-by: Thiago Macieira --- src/corelib/text/qlocale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index d240494018..eb180388a1 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -3565,7 +3565,7 @@ QString QCalendarBackend::dateTimeToString(QStringView format, const QDateTime & } } if (!used) - result.append(QString(repeat, c)); + result.resize(result.size() + repeat, c); i += repeat; }