-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
5.1.0
-
None
-
Windows 7
QString& QString::replace(const QRegExp &rx, const QString &after) { QRegExp rx2(rx); if (isEmpty() && rx2.indexIn(*this) == -1) return *this;
That && should be ||
The line is saying that if the string is empty and does not contain the search string, then return. Of course, if the string is empty, we already know it does not contain the search string. I would think that we would want to return if the string is empty or it does not contain the search string.
This causes replace to always allocate memory unless the string is empty.
For Gerrit Dashboard: QTBUG-46879 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
115278,2 | Fix wrong check in QString::replace using QRegExp | 5.5 | qt/qtbase | Status: ABANDONED | -1 | 0 |