We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f836937 commit 8e2de98Copy full SHA for 8e2de98
[refs]
@@ -1,2 +1,2 @@
1
---
2
-refs/heads/master: 9faaf9eaf499d6184df18e9fb09235de46b659b5
+refs/heads/master: 8e02a2bcb5f8d3dfe03816fed53c51f0a5500f71
trunk/src/lib/_vec.rs
@@ -20,10 +20,10 @@ type init_op[T] = fn(uint i) -> T;
20
21
fn init_fn[T](&init_op[T] op, uint n_elts) -> vec[T] {
22
let vec[T] v = alloc[T](n_elts);
23
- let uint i = n_elts;
24
- while (i > 0u) {
25
- i -= 1u;
+ let uint i = 0u;
+ while (i < n_elts) {
26
v += vec(op(i));
+ i += 1u;
27
}
28
ret v;
29
0 commit comments