diff options
author | Jani Heikkinen <jani.heikkinen@qt.io> | 2021-08-17 07:51:25 +0300 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2021-08-25 07:24:39 +0300 |
commit | 8320a92141b736683bb3372f754375cb52836f5d (patch) | |
tree | 78e7db129fa7d29e1db844b30a5f8e4d4d56dbc1 /tests/auto/corelib/text/qstring/tst_qstring.cpp | |
parent | 31ebf45781bdda505adafc76de6117d20069d084 (diff) |
Revert "QString::lastIndexOf: fix off-by-one for zero length matches"
This reverts commit be83ff65c424cff1036e7da19d6175826d9f7ed9.
The revert is needed as commit caused a regression in QString::lastIndexOf
and the regression is more critical than the original issue fixed by
the reverted commit.
Fixes: QTBUG-94215
Pick-to: 6.1
Change-Id: I785c39d4e0e73f38d5447942357eff0eb19e3f96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/text/qstring/tst_qstring.cpp')
-rw-r--r-- | tests/auto/corelib/text/qstring/tst_qstring.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index 4f9fa1ad0e..11e3b87abc 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -1669,7 +1669,7 @@ void tst_QString::lastIndexOf() QCOMPARE(haystack.lastIndexOf(needle.toLatin1().data(), from, cs), expected); #if QT_CONFIG(regularexpression) - if (from >= -1 && from < haystack.size() && needle.size() > 0) { + if (from >= -1 && from < haystack.size()) { // unfortunately, QString and QRegularExpression don't have the same out of bound semantics // I think QString is wrong -- See file log for contact information. { |