QList - fix a few doc issues
Though some of it was mensioned in the introduction to the class, we are not in O(1) if we modify a shared container. Change-Id: If63b4cb4bdfc98d6b1333bae307e5650341e5484 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
37ca2224ec
commit
cfb717d654
@ -647,7 +647,10 @@ void **QListData::erase(void **xi)
|
|||||||
\a i must be a valid index position in the list (i.e., 0 <= \a i <
|
\a i must be a valid index position in the list (i.e., 0 <= \a i <
|
||||||
size()).
|
size()).
|
||||||
|
|
||||||
This function is very fast (\l{constant time}).
|
If this function is called on a list that is currently being shared, it
|
||||||
|
will trigger a copy of all elements. Otherwise, this function runs in
|
||||||
|
\l{constant time}. If you do not want to modify the list you should use
|
||||||
|
QList::at().
|
||||||
|
|
||||||
\sa at(), value()
|
\sa at(), value()
|
||||||
*/
|
*/
|
||||||
@ -656,7 +659,7 @@ void **QListData::erase(void **xi)
|
|||||||
|
|
||||||
\overload
|
\overload
|
||||||
|
|
||||||
Same as at().
|
Same as at(). This function runs in \l{constant time}.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn QList::reserve(int alloc)
|
/*! \fn QList::reserve(int alloc)
|
||||||
@ -681,10 +684,10 @@ void **QListData::erase(void **xi)
|
|||||||
|
|
||||||
This is the same as list.insert(size(), \a value).
|
This is the same as list.insert(size(), \a value).
|
||||||
|
|
||||||
This operation is typically very fast (\l{constant time}),
|
If this list is not shared, this operation is typically
|
||||||
because QList preallocates extra space on both sides of its
|
very fast (amortized \l{constant time}), because QList
|
||||||
internal buffer to allow for fast growth at both ends of the
|
preallocates extra space on both sides of its internal
|
||||||
list.
|
buffer to allow for fast growth at both ends of the list.
|
||||||
|
|
||||||
\sa operator<<(), prepend(), insert()
|
\sa operator<<(), prepend(), insert()
|
||||||
*/
|
*/
|
||||||
@ -709,8 +712,9 @@ void **QListData::erase(void **xi)
|
|||||||
|
|
||||||
This is the same as list.insert(0, \a value).
|
This is the same as list.insert(0, \a value).
|
||||||
|
|
||||||
This operation is usually very fast (\l{constant time}), because
|
If this list is not shared, this operation is typically
|
||||||
QList preallocates extra space on both sides of its internal
|
very fast (amortized \l{constant time}), because QList
|
||||||
|
preallocates extra space on both sides of its internal
|
||||||
buffer to allow for fast growth at both ends of the list.
|
buffer to allow for fast growth at both ends of the list.
|
||||||
|
|
||||||
\sa append(), insert()
|
\sa append(), insert()
|
||||||
@ -802,7 +806,7 @@ void **QListData::erase(void **xi)
|
|||||||
same as takeAt(0). This function assumes the list is not empty. To
|
same as takeAt(0). This function assumes the list is not empty. To
|
||||||
avoid failure, call isEmpty() before calling this function.
|
avoid failure, call isEmpty() before calling this function.
|
||||||
|
|
||||||
This operation takes \l{constant time}.
|
If this list is not shared, this operation takes \l{constant time}.
|
||||||
|
|
||||||
If you don't use the return value, removeFirst() is more
|
If you don't use the return value, removeFirst() is more
|
||||||
efficient.
|
efficient.
|
||||||
@ -817,7 +821,7 @@ void **QListData::erase(void **xi)
|
|||||||
not empty. To avoid failure, call isEmpty() before calling this
|
not empty. To avoid failure, call isEmpty() before calling this
|
||||||
function.
|
function.
|
||||||
|
|
||||||
This operation takes \l{constant time}.
|
If this list is not shared, this operation takes \l{constant time}.
|
||||||
|
|
||||||
If you don't use the return value, removeLast() is more
|
If you don't use the return value, removeLast() is more
|
||||||
efficient.
|
efficient.
|
||||||
|
Loading…
Reference in New Issue
Block a user