summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 091f44736e..dd00456fb2 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -3382,7 +3382,7 @@ QString& QString::replace(QChar ch, const QString &after, Qt::CaseSensitivity cs
replace_helper(indices, pos, 1, after.constData(), after.size());
- if (Q_LIKELY(index == -1)) // Nothing left to replace
+ if (Q_LIKELY(index == size())) // Nothing left to replace
break;
// The call to replace_helper just moved what index points at:
index += pos*(after.size() - 1);