diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-21 14:32:10 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-21 20:11:32 +0000 |
commit | f091f371c486e04fed0b1083c163b1c2baaf028c (patch) | |
tree | 93d1af311bfff8d50dfba1de0811813bbc46556e /src/corelib/text/qstring.cpp | |
parent | a585ce70562cae09643e6eb488d457f7755c7c90 (diff) |
QByteArrayMatcher users: use the new QByteArrayView overloads
The new overloads mean that when passing QByteArrayView or
QLatin1String objects, we don't expand them into .data() and
.size() anymore.
Pick-to: 6.3
Change-Id: I0c898e0463d0bf81ce1f7d57e10e64f23bd84587
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 80b9653ec9..7a908cfd98 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -10526,8 +10526,8 @@ qsizetype QtPrivate::findString(QLatin1String haystack, qsizetype from, QLatin1S return from; if (cs == Qt::CaseSensitive) { - const QByteArrayMatcher matcher(needle.data(), needle.size()); - return matcher.indexIn(haystack.data(), haystack.size(), from); + const QByteArrayMatcher matcher(needle); + return matcher.indexIn(haystack, from); } // If the needle is sufficiently small we simply iteratively search through |