]> git.lizzy.rs Git - rust.git/commit
io: Simplify BufReader::with_capacity
authorUlrik Sverdrup <bluss@users.noreply.github.com>
Wed, 8 Jul 2015 01:20:00 +0000 (03:20 +0200)
committerUlrik Sverdrup <bluss@users.noreply.github.com>
Wed, 8 Jul 2015 17:40:40 +0000 (19:40 +0200)
commita5cc17adaadf9bc4da3b6b375879fda55ed823c9
tree7ef2b04e1a05017b36ea8e622008c60ba2394b7f
parent6ac0ba3c3a1fc20e17923724e1e7635131eb19d6
io: Simplify BufReader::with_capacity

Use the vec![] macro directly to create a sized, zeroed vector.

This should result in a big speedup when creating BufReader, because
vec![0; cap] compiles to a memset call, while the previous extend code
currently did not.
src/libstd/io/buffered.rs