From c38a1b4bb956350716863511573f29d17b3d587d Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 20 Apr 2017 01:33:21 +0200 Subject: [PATCH] QDateTime: replace home-grown version of qToStringViewIgnoringNull with the real thing Change-Id: Ie71ed4f5c9a2bd0b14818f0f3cff4f88c2100546 Reviewed-by: Lars Knoll --- src/corelib/tools/qdatetime.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 7ab7c0e2df..d3175fe0e1 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -70,13 +70,6 @@ QT_BEGIN_NAMESPACE -#if QT_STRINGVIEW_LEVEL < 2 -static inline QStringView quick_stringview_cast(const QString &format) -{ - return QStringView(format.data(), format.size()); // avoids isNull() check as we don't care -} -#endif - /***************************************************************************** Date/Time Constants *****************************************************************************/ @@ -945,7 +938,7 @@ QString QDate::toString(QStringView format) const #if QT_STRINGVIEW_LEVEL < 2 QString QDate::toString(const QString &format) const { - return toString(quick_stringview_cast(format)); + return toString(qToStringViewIgnoringNull(format)); } #endif @@ -1704,7 +1697,7 @@ QString QTime::toString(QStringView format) const #if QT_STRINGVIEW_VERSION < 2 QString QTime::toString(const QString &format) const { - return toString(quick_stringview_cast(format)); + return toString(qToStringViewIgnoringNull(format)); } #endif @@ -3967,7 +3960,7 @@ QString QDateTime::toString(QStringView format) const #if QT_STRINGVIEW_LEVEL < 2 QString QDateTime::toString(const QString &format) const { - return toString(quick_stringview_cast(format)); + return toString(qToStringViewIgnoringNull(format)); } #endif