Remove the setting of GrowsBackwards from QList

The flag is practically unused, there is no logic that relies on its
existence. From experience of prototyping prepend optimization (where
the flag actually makes sense), it is better to temporarily remove it:
QList is, in fact, unaware of how to correctly use it at the moment

Once GrowsBackwards-using code is implemented at the lower levels,
the usage of the flag will be reintroduced to QList along with the
changes that ensure correct behavior

Task-number: QTBUG-84320
Change-Id: I618adfcd69b15c76ddafd78cca5e9aa0073e4c91
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Andrei Golubev 2020-07-08 14:26:34 +03:00
parent 14a8fb2321
commit d9c40cf90e

View File

@ -591,8 +591,6 @@ QList<T>::insert(qsizetype i, qsizetype n, parameter_type t)
const size_t newSize = size() + n;
if (d->needsDetach() || newSize > d->allocatedCapacity()) {
typename Data::ArrayOptions flags = d->detachFlags() | Data::GrowsForward;
if (size_t(i) <= newSize / 4)
flags |= Data::GrowsBackwards;
DataPointer detached(Data::allocate(d->detachCapacity(newSize), flags));
const_iterator where = constBegin() + i;
@ -622,8 +620,6 @@ QList<T>::emplace(qsizetype i, Args&&... args)
const size_t newSize = size() + 1;
if (d->needsDetach() || newSize > d->allocatedCapacity()) {
typename Data::ArrayOptions flags = d->detachFlags() | Data::GrowsForward;
if (size_t(i) <= newSize / 4)
flags |= Data::GrowsBackwards;
DataPointer detached(Data::allocate(d->detachCapacity(newSize), flags));
const_iterator where = constBegin() + i;