diff options
| author | Roy Frostig <[email protected]> | 2010-08-03 18:10:18 -0700 |
|---|---|---|
| committer | Roy Frostig <[email protected]> | 2010-08-03 18:10:18 -0700 |
| commit | 5796ebb1e7b4f96a362604af378fa5e4e08e6306 (patch) | |
| tree | f5a48b91d7f280adec5235be3d3cdcab00cf2524 | |
| parent | Pass parametric types by-alias in various stdlib spots. (diff) | |
| download | rust-5796ebb1e7b4f96a362604af378fa5e4e08e6306.tar.xz rust-5796ebb1e7b4f96a362604af378fa5e4e08e6306.zip | |
Address _vec.grow FIXME, as issue #89 has been closed.
| -rw-r--r-- | src/lib/_vec.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lib/_vec.rs b/src/lib/_vec.rs index bec3d99e..13fbeb6a 100644 --- a/src/lib/_vec.rs +++ b/src/lib/_vec.rs @@ -68,15 +68,12 @@ fn slice[T](vec[T] v, int start, int end) -> vec[T] { ret result; } -// Ought to take mutable &vec[T] v and just mutate it instead of copy -// and return. Blocking on issue #89 for this. -fn grow[T](mutable vec[T] v, int n, &T initval) -> vec[T] { +fn grow[T](&mutable vec[T] v, int n, &T initval) { let int i = n; while (i > 0) { i -= 1; v += vec(initval); } - ret v; } fn map[T,U](&op[T,U] f, &vec[T] v) -> vec[U] { |