From 215bda50f959673f076fe76cf1f95a2a5f759b2c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 28 Feb 2015 15:18:39 +0100 Subject: QtGui: replace QStringLiteral with QLatin1String when appending It makes little sense to use QStringLiteral for strings which are immediately appended to, or which are appended to other strings, because no dynamic memory allocation is saved by doing so. But if the only advantage of QStringLiteral does not apply, all its disadvantages dominate, to wit: injection of calls to qstring dtor, non-sharability of data between C strings and QStringLiterals and among QStringLiterals, and doubled storage requirements. Fix by replacing QStringLiteral with QLatin1String. Saves 104B in text size on stripped optimized Linux AMD64 GCC 4.9 builds. Change-Id: I36b6a9bb1963b69361cc3a3db0971e1db92f0080 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/util/qvalidator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/util') diff --git a/src/gui/util/qvalidator.cpp b/src/gui/util/qvalidator.cpp index 430de3aef8..90c6e7a7b8 100644 --- a/src/gui/util/qvalidator.cpp +++ b/src/gui/util/qvalidator.cpp @@ -1066,7 +1066,7 @@ void QRegularExpressionValidatorPrivate::setRegularExpression(const QRegularExpr if (origRe != re) { usedRe = origRe = re; // copies also the pattern options - usedRe.setPattern(QStringLiteral("\\A(?:") + re.pattern() + QStringLiteral(")\\z")); + usedRe.setPattern(QLatin1String("\\A(?:") + re.pattern() + QLatin1String(")\\z")); emit q->regularExpressionChanged(re); emit q->changed(); } -- cgit v1.2.3