QList: do some minor cleanups in the internal code

Change-Id: I7e502e4d2fa5af94c20e7da62d1c06597b6b16a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Andrei Golubev 2021-05-25 16:09:03 +02:00
parent fd9c2c8033
commit 6ac2b902d1
2 changed files with 1 additions and 2 deletions

View File

@ -84,7 +84,7 @@ public:
Q_ASSERT(newSize - this->size <= this->freeSpaceAtEnd());
T *where = this->end();
this->size = qsizetype(newSize);
this->size = newSize;
const T *e = this->end();
while (where != e)
*where++ = T();

View File

@ -228,7 +228,6 @@ public:
if (n > 0)
Q_CHECK_PTR(dp.data());
if (where == QArrayData::GrowsAtBeginning) {
Q_ASSERT(dp.ptr);
Q_ASSERT(dp.freeSpaceAtBegin() >= n);
} else {
Q_ASSERT(dp.freeSpaceAtEnd() >= n);