Skip to content

Commit 8a8fba7

Browse files
committed
---
yaml --- r: 228195 b: refs/heads/try c: a5cc17a h: refs/heads/master i: 228193: a501191 228191: c4f6d2d v: v3
1 parent d0d4fa2 commit 8a8fba7

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 6ac0ba3c3a1fc20e17923724e1e7635131eb19d6
4+
refs/heads/try: a5cc17adaadf9bc4da3b6b375879fda55ed823c9
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/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)