diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index 57e7f0ffe5f..a6f2722cf8b 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -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(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); } }