summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qstring.h')
-rw-r--r--src/corelib/tools/qstring.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 23972d196c..e9a205dfdf 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -1021,12 +1021,7 @@ QT_WARNING_DISABLE_INTEL(111) // "statement is unreachable"
inline int QString::toWCharArray(wchar_t *array) const
{
- if (sizeof(wchar_t) == sizeof(QChar)) {
- memcpy(array, d->data(), sizeof(QChar) * size());
- return size();
- } else {
- return toUcs4_helper(d->data(), size(), reinterpret_cast<uint *>(array));
- }
+ return QStringView(*this).toWCharArray(array);
}
QT_WARNING_POP