File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: cfa09d35a355dee59008306f98330ff0472eb09d
5
+ refs/heads/try: f029e1f486d965c0a20410644e9faa9b294e03c9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export eq_vec;
20
20
// union, intersection, and difference. At that point, we could write
21
21
// an optimizing version of this module that produces a different obj
22
22
// for the case where nbits <= 32.
23
+ // (Issue #2341)
23
24
24
25
#[ doc = "The bitvector type" ]
25
26
type bitv = @{ storage : [ mut uint ] , nbits : uint } ;
@@ -104,24 +105,18 @@ pure fn get(v: bitv, i: uint) -> bool {
104
105
}
105
106
106
107
// FIXME: This doesn't account for the actual size of the vectors,
107
- // so it could end up comparing garbage bits
108
+ // so it could end up comparing garbage bits (#2342)
108
109
#[ doc = "
109
110
Compares two bitvectors
110
111
111
112
Both bitvectors must be the same length. Returns `true` if both bitvectors
112
113
contain identical elements.
113
114
" ]
114
115
fn equal ( v0 : bitv , v1 : bitv ) -> bool {
115
- // FIXME: when we can break or return from inside an iterator loop,
116
- // we can eliminate this painful while-loop
117
-
118
116
let len = vec:: len ( v1. storage ) ;
119
- let mut i = 0 u;
120
- while i < len {
117
+ for uint:: iterate( 0 u, len) { |i|
121
118
if v0. storage [ i] != v1. storage [ i] { ret false ; }
122
- i = i + 1 u;
123
119
}
124
- ret true;
125
120
}
126
121
127
122
#[ doc = "Set all bits to 0" ]
You can’t perform that action at this time.
0 commit comments