diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2021-08-16 20:20:48 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2021-08-18 10:21:04 +0300 |
commit | 61525c4f41f0053099c461aa016f7eea062e6555 (patch) | |
tree | f0cae2208d0d40ea92c3bfe1bcaa50221570ef04 /tests | |
parent | b3676ddd0a541decf193abb6605b20d93c07f7f9 (diff) |
Revert "QString::lastIndexOf: fix off-by-one for zero length matches"
This reverts commit 3a273ac47f20e82a1f2f63411b210025ca0f4495.
The revert is needed as QString::lastIndexOf was broken after
the original patch.
Task-number: QTBUG-94215
Change-Id: Ic1c81daa7b5ce8861911210ff34049ed7704ed4a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-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 49dc23a695..696b8159ac 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -1675,7 +1675,7 @@ void tst_QString::lastIndexOf() QCOMPARE(haystack.lastIndexOf(needle.toLatin1(), from, cs), expected); QCOMPARE(haystack.lastIndexOf(needle.toLatin1().data(), from, cs), expected); - if (from >= -1 && from < haystack.size() && needle.size() > 0) { + if (from >= -1 && from < haystack.size()) { // unfortunately, QString and QRegExp don't have the same out of bound semantics // I think QString is wrong -- See file log for contact information. { |