diff options
author | Øystein Heskestad <oystein.heskestad@qt.io> | 2022-01-07 09:57:34 +0100 |
---|---|---|
committer | Øystein Heskestad <oystein.heskestad@qt.io> | 2022-01-17 09:48:12 +0100 |
commit | 74955f386d859ffe573487b73e17e81754bd6e8b (patch) | |
tree | a14e08a1a488fbff912feffc875de6dbccff8047 /src/corelib/io/qdir.cpp | |
parent | 88dda89329330119bcb97788e84a30b2bf1cb23a (diff) |
Replace QString::utf16 with QString::data where appropriate
QString::utf16() needlessly detaches fromRawData() to ensure a
terminating NUL. Use data() where we don't require said NUL, taking
care not call the mutable data() overload, which would detach,
too.
Task-number: QTBUG-98763
Change-Id: Ibd5e56798c0c666893c12c91ff0881842b8430c7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/io/qdir.cpp')
-rw-r--r-- | src/corelib/io/qdir.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index bae47bfb2b..fbde6b69fd 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -2172,7 +2172,7 @@ QString qt_normalizePathSegments(const QString &name, QDirPrivate::PathNormaliza QVarLengthArray<char16_t> outVector(len); int used = len; char16_t *out = outVector.data(); - const ushort *p = name.utf16(); + const ushort *p = reinterpret_cast<const ushort *>(name.data()); const ushort *prefix = p; int up = 0; |