diff options
author | Anton Kudryavtsev <antkudr@mail.ru> | 2019-03-13 00:20:25 +0300 |
---|---|---|
committer | Anton Kudryavtsev <antkudr@mail.ru> | 2019-03-22 16:36:17 +0000 |
commit | 68d75aef76b24086ea676aa1646fec4e9358f0de (patch) | |
tree | 08694e1eb4a5c93c3930afc324acf00d5f9c9eda /src/corelib/tools/qregexp.cpp | |
parent | 3b38c73c7ffa71c00c172cf0e05742835a304300 (diff) |
qstringalgorithms: add find methods
Also add qsizetype support. It's needed to
add find methods to QStringView
Change-Id: I45eac082924e27778c24eebbb19d694221c28978
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qregexp.cpp')
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 87b30c952e..589eb74520 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -58,9 +58,6 @@ QT_BEGIN_NAMESPACE -int qFindString(const QChar *haystack, int haystackLen, int from, - const QChar *needle, int needleLen, Qt::CaseSensitivity cs); - // error strings for the regexp parser #define RXERR_OK QT_TRANSLATE_NOOP("QRegExp", "no error occurred") #define RXERR_DISABLED QT_TRANSLATE_NOOP("QRegExp", "disabled feature used") @@ -1423,7 +1420,8 @@ void QRegExpMatchState::match(const QChar *str0, int len0, int pos0, #ifndef QT_NO_REGEXP_OPTIM if (eng->trivial && !oneTest) { - pos = qFindString(str0, len0, pos0, eng->goodStr.unicode(), eng->goodStr.length(), eng->cs); + // ### Qt6: qsize + pos = int(QtPrivate::findString(QStringView(str0, len0), pos0, QStringView(eng->goodStr.unicode(), eng->goodStr.length()), eng->cs)); matchLen = eng->goodStr.length(); matched = (pos != -1); } else |