diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-10-30 14:10:31 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-11-04 11:21:41 +0100 |
commit | 419eaa0679c3867d8d9a3da8845a3015e29800d7 (patch) | |
tree | bf867e2c1dfcf1a53d750261c8da3016d4db5093 /src/corelib/text/qbytearray.cpp | |
parent | 32a703e2779e697a9a7d75f6cbc6e555187d7fca (diff) |
Cleanup QArrayDataOps::reallocate() and related
Don't use QArrayData::GrowsForward/Backward anymore and replace
it with a simple 'bool grow'.
Change-Id: Ifddfef3ae860b11dda4c40854c71ef2aeb29df34
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qbytearray.cpp')
-rw-r--r-- | src/corelib/text/qbytearray.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 945a2a26fd..1a1b2d86b0 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -671,7 +671,7 @@ QByteArray qUncompress(const uchar* data, qsizetype nbytes) return invalidCompressedData(); } else { // grow the block - d->reallocate(d->allocatedCapacity()*2); + d->reallocate(d->allocatedCapacity()*2, QArrayData::Grow); if (Q_UNLIKELY(d.data() == nullptr)) return invalidCompressedData(); } @@ -1719,7 +1719,7 @@ void QByteArray::reallocData(qsizetype alloc, Data::ArrayOptions options) dd.data()[dd.size] = 0; d = dd; } else { - d->reallocate(alloc); + d->reallocate(alloc, options & (QArrayData::GrowsBackwards|QArrayData::GrowsForward) ? QArrayData::Grow : QArrayData::KeepSize); } } @@ -1734,7 +1734,7 @@ void QByteArray::reallocGrowData(qsizetype n) dd.data()[dd.size] = 0; d = dd; } else { - d->reallocate(d.constAllocatedCapacity() + n); + d->reallocate(d.constAllocatedCapacity() + n, QArrayData::Grow); } } |