summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstringbuilder.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-07-30 17:36:14 +0200
committerMÃ¥rten Nordheim <marten.nordheim@qt.io>2020-10-06 11:16:36 +0200
commitfa8d021fa6fcb040fb702b6ffd2deee52a3b748a (patch)
tree15c6a311dcf9e6c64a162ba62d2d9a83846ba159 /src/corelib/text/qstringbuilder.cpp
parent40874625f996899ca1e976f0240da697e784c2c6 (diff)
Convert a couple of APIs to use views
Try to get rid of APIs that use raw 'const {char, QChar} *, length' pairs. Instead, use QByteArrayView or QStringView. As QStringConverter is a new class, simply change the API to what we'd like to have. Also adjust hidden API in QStringBuilder and friends. Change-Id: I897d47f63a7b965f5574a1e51da64147f9e981f6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/text/qstringbuilder.cpp')
-rw-r--r--src/corelib/text/qstringbuilder.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/corelib/text/qstringbuilder.cpp b/src/corelib/text/qstringbuilder.cpp
index 3016392e457..dcb3644fb09 100644
--- a/src/corelib/text/qstringbuilder.cpp
+++ b/src/corelib/text/qstringbuilder.cpp
@@ -124,14 +124,9 @@ QT_BEGIN_NAMESPACE
/*!
\internal
*/
-void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out) noexcept
+void QAbstractConcatenable::convertFromUtf8(QByteArrayView in, QChar *&out) noexcept
{
- if (Q_UNLIKELY(len == -1)) {
- if (!a)
- return;
- len = int(strlen(a));
- }
- out = QUtf8::convertToUnicode(out, a, len);
+ out = QUtf8::convertToUnicode(out, in);
}
QT_END_NAMESPACE