Skip to content

Commit f84217c

Browse files
committed
---
yaml --- r: 5614 b: refs/heads/master c: 6dece91 h: refs/heads/master v: v3
1 parent b194d9b commit f84217c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
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: c04efec87fae9b7c4c9e93243816f73802a91e56
2+
refs/heads/master: 6dece91ed3883a4b81986404004d90b6a6f0b30a

trunk/src/lib/vec.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,16 @@ fn enum_uints(start: uint, end: uint) : uint::le(start, end) -> [uint] {
332332
ret r;
333333
}
334334

335+
fn eachi<@T>(f: block(T, uint) -> (), v: [mutable? T]) {
336+
let i = 0u;
337+
let l = len(v);
338+
while (i < l) {
339+
let elem = v[i]; // Satisfy alias checker
340+
f(elem, i);
341+
i += 1u;
342+
}
343+
}
344+
335345
// Iterate over a list with with the indexes
336346
iter iter2<@T>(v: [T]) -> (uint, T) {
337347
let i = 0u;

0 commit comments

Comments
 (0)