aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-08-03 18:18:19 -0700
committerRoy Frostig <[email protected]>2010-08-03 18:18:19 -0700
commit5b2451c2318499310a0183ff518ffb7d308aafa2 (patch)
tree62f771d11d56ecf32fe74c9a77d2491d2ee94740 /src/lib
parentAddress _vec.grow FIXME, as issue #89 has been closed. (diff)
downloadrust-5b2451c2318499310a0183ff518ffb7d308aafa2.tar.xz
rust-5b2451c2318499310a0183ff518ffb7d308aafa2.zip
Address _vec.map allocation FIXME. Add test.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/_vec.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/lib/_vec.rs b/src/lib/_vec.rs
index 13fbeb6a..43779015 100644
--- a/src/lib/_vec.rs
+++ b/src/lib/_vec.rs
@@ -76,14 +76,10 @@ fn grow[T](&mutable vec[T] v, int n, &T initval) {
}
}
-fn map[T,U](&op[T,U] f, &vec[T] v) -> vec[U] {
- // FIXME: should be
- // let vec[U] u = alloc[U](len[T](v));
- // but this does not work presently.
- let vec[U] u = vec();
+fn map[T, U](&op[T,U] f, &vec[T] v) -> vec[U] {
+ let vec[U] u = alloc[U](len[T](v));
for (T ve in v) {
u += vec(f(ve));
}
ret u;
}
-