diff --git a/src/lib/bitv.rs b/src/lib/bitv.rs index 708cc621868b..5ea8e456684c 100644 --- a/src/lib/bitv.rs +++ b/src/lib/bitv.rs @@ -5,7 +5,6 @@ // FIXME: Almost all the functions in this module should be state fns, but the // effect system isn't currently working correctly. - state type t = rec(vec[mutable uint] storage, uint nbits); // FIXME: this should be a constant once they work @@ -114,6 +113,12 @@ fn clear(&t v) { } } +fn set_all(&t v) { + for each (uint i in _uint::range(0u, v.nbits)) { + set(v, i, true); + } +} + fn invert(&t v) { for each (uint i in uint::range(0u, vec::len(v.storage))) { v.storage.(i) = ~v.storage.(i);