diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-09 21:26:01 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-26 01:44:05 +0100 |
commit | b6251958932be5966258f362dc9bb7c7475d2d0a (patch) | |
tree | 2b2dc46c0d097fca15bcc9e2701682919921c339 /src/corelib/tools/qversionnumber.cpp | |
parent | 73a03a0c298461aa15d7c2757bc0b6444e5dc3dc (diff) |
QtCore: Replace remaining uses of QLatin1String with QLatin1StringView
Task-number: QTBUG-98434
Change-Id: Ib7c5fc0aaca6ef33b93c7486e99502c555bf20bc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/tools/qversionnumber.cpp')
-rw-r--r-- | src/corelib/tools/qversionnumber.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp index 784022f7bd..7ec0e45dd1 100644 --- a/src/corelib/tools/qversionnumber.cpp +++ b/src/corelib/tools/qversionnumber.cpp @@ -424,12 +424,12 @@ QString QVersionNumber::toString() const \snippet qversionnumber/main.cpp 3-latin1-1 \note In versions prior to Qt 6.4, this function was overloaded for QString, - QLatin1String and QStringView instead, and \a suffixIndex was an \c{int*}. + QLatin1StringView and QStringView instead, and \a suffixIndex was an \c{int*}. \sa isNull() */ -static QVersionNumber from_string(QLatin1String string, qsizetype *suffixIndex) +static QVersionNumber from_string(QLatin1StringView string, qsizetype *suffixIndex) { // 32 should be more than enough, and, crucially, it means we're allocating // not more (and often less) often when compared with direct QList usage @@ -462,7 +462,7 @@ static QVersionNumber from_string(QLatin1String string, qsizetype *suffixIndex) static QVersionNumber from_string(q_no_char8_t::QUtf8StringView string, qsizetype *suffixIndex) { - return from_string(QLatin1String(string.data(), string.size()), suffixIndex); + return from_string(QLatin1StringView(string.data(), string.size()), suffixIndex); } // in qstring.cpp @@ -473,7 +473,7 @@ static QVersionNumber from_string(QStringView string, qsizetype *suffixIndex) QVarLengthArray<char> copy; copy.resize(string.size()); qt_to_latin1(reinterpret_cast<uchar*>(copy.data()), string.utf16(), string.size()); - return from_string(QLatin1String(copy.data(), copy.size()), suffixIndex); + return from_string(QLatin1StringView(copy.data(), copy.size()), suffixIndex); } QVersionNumber QVersionNumber::fromString(QAnyStringView string, qsizetype *suffixIndex) |