Skip to content

Commit ad08dd1

Browse files
committed
---
yaml --- r: 218219 b: refs/heads/master c: a5cc17a h: refs/heads/master i: 218217: 866e14d 218215: ef03a4d v: v3
1 parent 1aa6829 commit ad08dd1

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,5 +1,5 @@
11
---
2-
refs/heads/master: 6ac0ba3c3a1fc20e17923724e1e7635131eb19d6
2+
refs/heads/master: a5cc17adaadf9bc4da3b6b375879fda55ed823c9
33
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/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)