From cc43a8de3b848667d77f8868f599759e554549ef Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 13 Dec 2019 15:34:20 +0000 Subject: [PATCH] optimize QRegExp::escape() for case that string will not need escaping Signed-off-by: Ivailo Monev --- src/core/tools/qregexp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/tools/qregexp.cpp b/src/core/tools/qregexp.cpp index df3c547f4..8bb409c10 100644 --- a/src/core/tools/qregexp.cpp +++ b/src/core/tools/qregexp.cpp @@ -4093,7 +4093,7 @@ QString QRegExp::escape(const QString &str) { QString quoted; const int count = str.count(); - quoted.reserve(count * 2); + quoted.reserve(count); const QLatin1Char backslash('\\'); for (int i = 0; i < count; i++) { const QChar c = str.at(i); -- 2.11.0