summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-01-15 23:48:52 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-01-18 01:31:33 +0100
commit9ffcab65629539c0335c78d9896153d9c31f475e (patch)
tree5276bfbe28dc2dcb5db1eba15051adf370ebfc32 /src/corelib/text/qstring.cpp
parent1a440e557b0efa9758f7d41112f09016ad385bab (diff)
QVersionNumber: port fromString() to QAnyStringView
We can handle the UTF-8 case by reinterpreting it as Latin-1. This way, the suffixIndex stays valid as a return value. As a drive-by, optimize away toLatin1() calls by using a QVLA. We really need a better way of converting UTF-16 -> L1 than qt_to_latin1()... [ChangeLog][QtCore][QVersionNumber] fromString() now takes QAnyStringView (was: QString, QStringView, QLatin1String) and a qsizetype pointer (was: int pointer). Change-Id: I86abaadba2792658fbf93ccd1e0b86e3302c697c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 9742f5ad83..23927b0e84 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -995,7 +995,7 @@ static void qt_to_latin1_internal(uchar *dst, const char16_t *src, qsizetype len
#endif
}
-static void qt_to_latin1(uchar *dst, const char16_t *src, qsizetype length)
+void qt_to_latin1(uchar *dst, const char16_t *src, qsizetype length)
{
qt_to_latin1_internal<true>(dst, src, length);
}