Skip to content

Commit f5766fd

Browse files
committed
---
yaml --- r: 122847 b: refs/heads/master c: da0d4be h: refs/heads/master i: 122845: 0428c5f 122843: 315aa11 122839: 1142ab8 122831: c2173c3 122815: 0c80265 v: v3
1 parent 92d54b5 commit f5766fd

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7a7ae993ce694bf75a11632b394916e055a4d8ec
2+
refs/heads/master: da0d4be378d289e9e90a48deec674d42205ae4c9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: aaff4e05e19b48d81e4ecb3337f288f42d06edd0
55
refs/heads/try: 2e9d9477b848cec778ca3f07ecdf0aea6ade23de

trunk/src/libcollections/bitv.rs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,6 @@ impl Bitv {
268268
!self.none()
269269
}
270270

271-
/**
272-
* Converts `self` to a vector of `uint` with the same length.
273-
*
274-
* Each `uint` in the resulting vector has either value `0u` or `1u`.
275-
*/
276-
pub fn to_vec(&self) -> Vec<uint> {
277-
Vec::from_fn(self.nbits, |i| if self.get(i) { 1 } else { 0 })
278-
}
279-
280271
/**
281272
* Organise the bits into bytes, such that the first bit in the
282273
* `Bitv` becomes the high-order bit of the first byte. If the
@@ -307,13 +298,6 @@ impl Bitv {
307298
)
308299
}
309300

310-
/**
311-
* Transform `self` into a `Vec<bool>` by turning each bit into a `bool`.
312-
*/
313-
pub fn to_bools(&self) -> Vec<bool> {
314-
Vec::from_fn(self.nbits, |i| self[i])
315-
}
316-
317301
/**
318302
* Compare a bitvector to a vector of `bool`.
319303
*
@@ -328,11 +312,6 @@ impl Bitv {
328312
}
329313
true
330314
}
331-
332-
pub fn ones(&self, f: |uint| -> bool) -> bool {
333-
range(0u, self.nbits).advance(|i| !self.get(i) || f(i))
334-
}
335-
336315
}
337316

338317
/**
@@ -1157,7 +1136,7 @@ mod tests {
11571136
#[test]
11581137
fn test_to_bools() {
11591138
let bools = vec!(false, false, true, false, false, true, true, false);
1160-
assert_eq!(from_bytes([0b00100110]).to_bools(), bools);
1139+
assert_eq!(from_bytes([0b00100110]).iter().collect::<Vec<bool>>(), bools);
11611140
}
11621141

11631142
#[test]
@@ -1225,7 +1204,7 @@ mod tests {
12251204
fn test_small_clear() {
12261205
let mut b = Bitv::new(14, true);
12271206
b.clear();
1228-
b.ones(|i| {
1207+
BitvSet::from_bitv(b).iter().advance(|i| {
12291208
fail!("found 1 at {:?}", i)
12301209
});
12311210
}
@@ -1234,7 +1213,7 @@ mod tests {
12341213
fn test_big_clear() {
12351214
let mut b = Bitv::new(140, true);
12361215
b.clear();
1237-
b.ones(|i| {
1216+
BitvSet::from_bitv(b).iter().advance(|i| {
12381217
fail!("found 1 at {:?}", i)
12391218
});
12401219
}

0 commit comments

Comments
 (0)