Skip to content

Commit 5973e65

Browse files
committed
---
yaml --- r: 6019 b: refs/heads/master c: 1da99cd h: refs/heads/master i: 6017: 8fbe448 6015: b70bc0b v: v3
1 parent 904ad25 commit 5973e65

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: d53a253dcae826eb50856bf28c90f2a0c84dec33
2+
refs/heads/master: 1da99cdf687e91e5df579d518a8b16871b0686a1

trunk/src/lib/list.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,7 @@ Function: from_vec
2626
Create a list from a vector
2727
*/
2828
fn from_vec<T>(v: [mutable? T]) -> list<T> {
29-
let l = nil::<T>;
30-
// FIXME: This would be faster and more space efficient if it looped over
31-
// a reverse vector iterator. Unfortunately generic iterators seem not to
32-
// work yet.
33-
34-
for item: T in vec::reversed(v) { l = cons::<T>(item, @l); }
35-
ret l;
29+
*vec::foldr({ |h, t| @cons(h, t) }, @nil::<T>, v)
3630
}
3731

3832
/*

0 commit comments

Comments
 (0)