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. Pick-to: 6.0 Task-number: QTBUG-87962 Change-Id: I7b6dfb536d143d78c441214f83320c1bf1263e0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
5545b0f1d3
commit
6364194456
@ -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()
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user