]> git.lizzy.rs Git - rust.git/commit
Switch Vec from doubling size on growth to using RawVec's reserve
authorgnzlbg <gonzalobg88@gmail.com>
Mon, 14 May 2018 11:58:28 +0000 (13:58 +0200)
committergnzlbg <gonzalobg88@gmail.com>
Mon, 14 May 2018 11:58:28 +0000 (13:58 +0200)
commit50c4506329673d38b3170f048f546a5885dd8310
tree7c62848363047e2e1cac7cb78e183cab79297e02
parent8f39dbae8cdc4418d3f79c719bd91d8b4f09c86b
Switch Vec from doubling size on growth to using RawVec's reserve

On growth, Vec does not require to exactly double its size for correctness,
like, for example, VecDeque does.

Using reserve instead better expresses this intent. It also allows to reuse
Excess capacity on growth and for better growth-policies to be provided by
RawVec.
src/liballoc/vec.rs