From b6251958932be5966258f362dc9bb7c7475d2d0a Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Wed, 9 Mar 2022 21:26:01 +0100 Subject: QtCore: Replace remaining uses of QLatin1String with QLatin1StringView Task-number: QTBUG-98434 Change-Id: Ib7c5fc0aaca6ef33b93c7486e99502c555bf20bc Reviewed-by: Edward Welbourne Reviewed-by: Marc Mutz --- src/corelib/tools/qversionnumber.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/tools/qversionnumber.cpp') 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 copy; copy.resize(string.size()); qt_to_latin1(reinterpret_cast(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) -- cgit v1.2.3