QString: use QCommonArrayOps::erase instead of custom logic
With 6e8985e3576a4439bd66c0767f9912d1e124682c merged we can now use generic erase logic provided by array operations. This commit aligns QString with QList/QByteArray Task-number: QTBUG-84320 Change-Id: I83e9349e2461afd98737df25613aa2d0fd817a71 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
184e385aa2
commit
1ca3af0a71
@ -2974,10 +2974,8 @@ QString &QString::remove(qsizetype pos, qsizetype len)
|
||||
resize(pos); // truncate
|
||||
} else if (len > 0) {
|
||||
detach();
|
||||
memmove(d.data() + pos, d.data() + pos + len,
|
||||
(d.size - pos - len) * sizeof(QChar));
|
||||
d.size -= len;
|
||||
d.data()[d.size] = '\0';
|
||||
d->erase(d.begin() + pos, d.begin() + pos + len);
|
||||
d.data()[d.size] = u'\0';
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user