Skip to content

Commit 202f400

Browse files
committed
---
yaml --- r: 153125 b: refs/heads/try2 c: da0d4be h: refs/heads/master i: 153123: c02de10 v: v3
1 parent 36bde3e commit 202f400

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 7a7ae993ce694bf75a11632b394916e055a4d8ec
8+
refs/heads/try2: da0d4be378d289e9e90a48deec674d42205ae4c9
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)