Skip to content

Commit e07d041

Browse files
committed
---
yaml --- r: 13479 b: refs/heads/master c: ffc9fff h: refs/heads/master i: 13477: 752f5ec 13475: ef6ee0e 13471: 44deac9 v: v3
1 parent 1fa0eae commit e07d041

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
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: 97bcb2024440935f5e9ba2ac6116dc1ac8702824
2+
refs/heads/master: ffc9fff720c33776d681034b7b7c8d920b2d6a15
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/dvec.rs

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl extensions<A> for dvec<A> {
129129
#[doc = "Overwrite the current contents"]
130130
fn set(+w: [mut A]) {
131131
self.check_not_borrowed();
132-
self.data <- w; //FIXME check for recursive use
132+
self.data <- w; //FIXME check for recursive use (#2607)
133133
}
134134
}
135135

@@ -177,25 +177,28 @@ impl extensions<A:copy> for dvec<A> {
177177
}
178178
}
179179

180-
//FIXME--
181-
//#[doc = "
182-
// Append all elements of an iterable.
183-
//
184-
// Failure will occur if the iterable's `each()` method
185-
// attempts to access this vector.
186-
//"]
187-
//fn append_iter<I:iter::base<A>>(ts: I) {
188-
// self.data.swap { |v|
189-
// alt ts.size_hint() {
190-
// none {}
191-
// some(h) { vec::reserve(v, len(v) + h) }
192-
// }
193-
//
194-
// for ts.each { |t| v = v + [t] };
195-
//
196-
// v
197-
// }
198-
//}
180+
#[doc = "
181+
Append all elements of an iterable.
182+
183+
Failure will occur if the iterable's `each()` method
184+
attempts to access this vector.
185+
"]
186+
fn append_iter<A, I:iter::base_iter<A>>(ts: I) {
187+
self.swap { |v|
188+
let mut v = alt ts.size_hint() {
189+
none { v }
190+
some(h) {
191+
let len = v.len() + h;
192+
let mut v <- v;
193+
vec::reserve(v, len);
194+
v
195+
}
196+
};
197+
198+
for ts.each { |t| v += [t] };
199+
v
200+
}
201+
}
199202

200203
#[doc = "
201204
Gets a copy of the current contents.

0 commit comments

Comments
 (0)