QList docs: extend prepend() description

Current description was confronting the general description of the
class, which states that prepend() is fast.
The updated description gives more information about the method's
behavior in different conditions.

Task-number: QTBUG-87962
Change-Id: I7b6dfb536d143d78c441214f83320c1bf1263e0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6364194456ec92a2c09a339d20b868bb49bd00e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ivan Solovev 2020-11-27 19:37:11 +01:00 committed by Qt Cherry-pick Bot
parent 2f0136d591
commit 676b912cf9

View File

@ -681,11 +681,12 @@
This is the same as list.insert(0, \a value).
For large lists, this operation can be slow (\l{linear time}),
because it requires moving all the items in the list by one
position further in memory. If you want a container class that
provides a fast prepend operation, use std::list
instead.
Normally this operation is relatively fast (amortized \l{constant time}).
QList is able to allocate extra memory at the beginning of the list data
and grow in that direction without reallocating or moving the data on each
operation. However if you want a container class with a guarantee of
\l{constant time} prepend, use std::list instead,
but prefer QList otherwise.
\sa append(), insert()
*/