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/qstring.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/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 3e6188a38d..ebdb571041 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -2516,7 +2516,7 @@ void QString::reallocData(qsizetype alloc, Data::ArrayOptions allocOptions) dd.data()[dd.size] = 0; d = dd; } else { - d->reallocate(alloc); + d->reallocate(alloc, allocOptions & (QArrayData::GrowsBackwards|QArrayData::GrowsForward) ? QArrayData::Grow : QArrayData::KeepSize); } } @@ -2531,7 +2531,7 @@ void QString::reallocGrowData(qsizetype n) dd.data()[dd.size] = 0; d = dd; } else { - d->reallocate(d.constAllocatedCapacity() + n); + d->reallocate(d.constAllocatedCapacity() + n, QArrayData::Grow); } } |