diff options
Diffstat (limited to 'src/corelib/tools/qarraydataops.h')
| -rw-r--r-- | src/corelib/tools/qarraydataops.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index c1ae93dc104..5f43ed3dc0d 100644 --- a/src/corelib/tools/qarraydataops.h +++ b/src/corelib/tools/qarraydataops.h @@ -83,8 +83,11 @@ public: Q_ASSERT(newSize > this->size); Q_ASSERT(newSize - this->size <= this->freeSpaceAtEnd()); - ::memset(static_cast<void *>(this->end()), 0, (newSize - this->size) * sizeof(T)); + T *where = this->end(); this->size = qsizetype(newSize); + const T *e = this->end(); + while (where != e) + *where++ = T(); } void copyAppend(const T *b, const T *e) noexcept @@ -675,7 +678,6 @@ protected: using DataPointer = QArrayDataPointer<T>; public: - // using QGenericArrayOps<T>::appendInitialize; // using QGenericArrayOps<T>::copyAppend; // using QGenericArrayOps<T>::moveAppend; // using QGenericArrayOps<T>::truncate; |
