QBitArray: simplify resize()
Use the new (in Qt 6.4) QByteArray::resize(n, ch) to avoid the manual memset() unpleasentness. Pick-to: 6.7 Change-Id: I786988125f52b1bc1f733c30ab2b95eda569481d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
0d6ca27517
commit
efc579145e
@ -208,11 +208,7 @@ void QBitArray::resize(qsizetype size)
|
||||
if (!size) {
|
||||
d.resize(0);
|
||||
} else {
|
||||
qsizetype s = d.size();
|
||||
d.resize(allocation_size(size));
|
||||
uchar *c = reinterpret_cast<uchar *>(d.data());
|
||||
if (d.size() > s)
|
||||
memset(c + s, 0, d.size() - s);
|
||||
d.resize(allocation_size(size), 0x00);
|
||||
adjust_head_and_tail(d.data(), d.size(), size);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user