Skip to content

Commit e3a48b2

Browse files
committed
---
yaml --- r: 235266 b: refs/heads/stable c: a5cc17a h: refs/heads/master v: v3
1 parent 245975e commit e3a48b2

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 6ac0ba3c3a1fc20e17923724e1e7635131eb19d6
32+
refs/heads/stable: a5cc17adaadf9bc4da3b6b375879fda55ed823c9
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/libstd/io/buffered.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use error;
1919
use fmt;
2020
use io::{self, DEFAULT_BUF_SIZE, Error, ErrorKind, SeekFrom};
2121
use ptr;
22-
use iter;
2322

2423
/// Wraps a `Read` and buffers input from it
2524
///
@@ -63,11 +62,9 @@ impl<R: Read> BufReader<R> {
6362
/// Creates a new `BufReader` with the specified buffer capacity
6463
#[stable(feature = "rust1", since = "1.0.0")]
6564
pub fn with_capacity(cap: usize, inner: R) -> BufReader<R> {
66-
let mut buf = Vec::with_capacity(cap);
67-
buf.extend(iter::repeat(0).take(cap));
6865
BufReader {
6966
inner: inner,
70-
buf: buf,
67+
buf: vec![0; cap],
7168
pos: 0,
7269
cap: 0,
7370
}

0 commit comments

Comments
 (0)