QString: use qustrlen() in the QChar* constructor
Instead of a manual loop, which was there since at least Qt 4.5.1 (beginning of the public history). Change-Id: Ifa1111900d6945ea8e05fffd177dd3dfea450a67 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 9c70e117114b51d3c72283d976048e2768968039) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
d0968b6ddf
commit
25d7fa178b
@ -2482,11 +2482,8 @@ QString::QString(const QChar *unicode, qsizetype size)
|
||||
if (!unicode) {
|
||||
d.clear();
|
||||
} else {
|
||||
if (size < 0) {
|
||||
size = 0;
|
||||
while (!unicode[size].isNull())
|
||||
++size;
|
||||
}
|
||||
if (size < 0)
|
||||
size = QtPrivate::qustrlen(reinterpret_cast<const char16_t *>(unicode));
|
||||
if (!size) {
|
||||
d = DataPointer::fromRawData(&_empty, 0);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user