@@ -637,43 +637,30 @@ fn enum_uints(start: uint, end: uint) : uint::le(start, end) -> [uint] {
637
637
ret r;
638
638
}
639
639
640
- /*
641
- Function: eachi
642
-
643
- Iterates over a vector's elements and indexes
644
-
645
- Iterates over vector `v` and, for each element, calls function `f`
646
- with the element's value and index.
647
- */
648
- fn eachi < T > ( f : block ( T , uint ) -> ( ) , v : [ mutable? T ] ) {
649
- let i = 0 u;
650
- let l = len ( v) ;
651
- while ( i < l) {
652
- let elem = v[ i] ; // Satisfy alias checker
653
- f ( elem, i) ;
654
- i += 1 u;
655
- }
656
- }
657
-
658
640
/*
659
641
Function: iter
660
642
661
643
Iterates over a vector
662
644
663
- Iterates over vector `v` and, for each element, calls function `f`
645
+ Iterates over vector `v` and, for each element, calls function `f` with the
646
+ element's value.
647
+
664
648
*/
665
- fn iter < T > ( v : [ mutable? T ] , it : block ( T ) ) {
666
- iter2 ( v) { |_i, v| it ( v) }
649
+ fn iter < T > ( v : [ mutable? T ] , f : block ( T ) ) {
650
+ iter2 ( v) { |_i, v| f ( v) }
667
651
}
668
652
669
653
/*
670
654
Function: iter2
671
655
672
- FIXME: This is exactly the same as eachi
656
+ Iterates over a vector's elements and indexes
657
+
658
+ Iterates over vector `v` and, for each element, calls function `f` with the
659
+ element's value and index.
673
660
*/
674
- fn iter2 < T > ( v : [ mutable? T ] , it : block ( uint , T ) ) {
661
+ fn iter2 < T > ( v : [ mutable? T ] , f : block ( uint , T ) ) {
675
662
let i = 0 u;
676
- for x in v { it ( i, x) ; i += 1 u; }
663
+ for x in v { f ( i, x) ; i += 1 u; }
677
664
}
678
665
679
666
/*
0 commit comments