OSDN Git Service
(root)
/
kde
/
Katie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f238cb
)
optimize QRegExp::escape() for case that string will not need escaping
author
Ivailo Monev
<xakepa10@laimg.moc>
Fri, 13 Dec 2019 15:34:20 +0000
(15:34 +0000)
committer
Ivailo Monev
<xakepa10@laimg.moc>
Fri, 13 Dec 2019 15:34:20 +0000
(15:34 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/tools/qregexp.cpp
patch
|
blob
|
history
diff --git
a/src/core/tools/qregexp.cpp
b/src/core/tools/qregexp.cpp
index
df3c547
..
8bb409c
100644
(file)
--- 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);