File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1441,10 +1441,14 @@ you expect that you're going to have to push a lot of values onto `s`, you can a
14411441the cost of incremental reallocation by doing it once up front; this can improve
14421442performance.
14431443
1444- If `first` is true, then the reserved space is from the start of the collection, for ordered
1445- collections. Supplying this keyword may result in an error if the collection is nor ordered
1444+ If `first` is `true`, then any additional space is reserved before the start of the collection.
1445+ This way, subsequent calls to `pushfirst!` (instead of `push!`) may become faster.
1446+ Supplying this keyword may result in an error if the collection is not ordered
14461447or if `pushfirst!` is not supported for this collection.
14471448
1449+ If `shrink=true` (the default), the collection's capacity may be reduced if its current
1450+ capacity is greater than `n`.
1451+
14481452See also [`resize!`](@ref).
14491453
14501454# Notes on the performance model
@@ -1460,8 +1464,6 @@ For types that support `sizehint!`,
14601464
146114653. `empty!` is nearly costless (and O(1)) for types that support this kind of preallocation.
14621466
1463- 4. `shrink` controls if the collection can be shrunk.
1464-
14651467!!! compat "Julia 1.11"
14661468 The `shrink` and `first` arguments were added in Julia 1.11.
14671469"""
You can’t perform that action at this time.
0 commit comments