diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-08-06 12:34:08 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-08-06 15:36:30 -0700 |
| commit | ecaf9e39c9435fa2de4fe393c4b263be36eb2d99 (patch) | |
| tree | 775f69be65adff65551d96173dd797e32e2c3157 /src/libstd/bitv.rs | |
| parent | d3a9bb1bd4a1d510bbaca2ab1121e4c85a239247 (diff) | |
| download | rust-ecaf9e39c9435fa2de4fe393c4b263be36eb2d99.tar.gz rust-ecaf9e39c9435fa2de4fe393c4b263be36eb2d99.zip | |
Convert alt to match. Stop parsing alt
Diffstat (limited to 'src/libstd/bitv.rs')
| -rw-r--r-- | src/libstd/bitv.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index de51e2b7f51..4b1fa4bfac9 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -179,9 +179,9 @@ class bitv { if self.nbits != other.nbits { self.die(); } - alt self.rep { - small(s) => alt other.rep { - small(s1) => alt op { + match self.rep { + small(s) => match other.rep { + small(s1) => match op { union => s.union(s1), intersect => s.intersect(s1), assign => s.become(s1), @@ -189,9 +189,9 @@ class bitv { } big(s1) => self.die() } - big(s) => alt other.rep { + big(s) => match other.rep { small(_) => self.die(), - big(s1) => alt op { + big(s1) => match op { union => s.union(s1), intersect => s.intersect(s1), assign => s.become(s1), @@ -232,7 +232,7 @@ class bitv { /// Makes a copy of a bitvector #[inline(always)] fn clone() -> ~bitv { - ~alt self.rep { + ~match self.rep { small(b) => { bitv{nbits: self.nbits, rep: small(~small_bitv{bits: b.bits})} } @@ -249,7 +249,7 @@ class bitv { #[inline(always)] pure fn get(i: uint) -> bool { assert (i < self.nbits); - alt self.rep { + match self.rep { big(b) => b.get(i), small(s) => s.get(i) } @@ -263,7 +263,7 @@ class bitv { #[inline(always)] fn set(i: uint, x: bool) { assert (i < self.nbits); - alt self.rep { + match self.rep { big(b) => b.set(i, x), small(s) => s.set(i, x) } @@ -278,12 +278,12 @@ class bitv { #[inline(always)] fn equal(v1: bitv) -> bool { if self.nbits != v1.nbits { return false; } - alt self.rep { - small(b) => alt v1.rep { + match self.rep { + small(b) => match v1.rep { small(b1) => b.equals(b1), _ => false } - big(s) => alt v1.rep { + big(s) => match v1.rep { big(s1) => s.equals(s1), small(_) => return false } @@ -293,7 +293,7 @@ class bitv { /// Set all bits to 0 #[inline(always)] fn clear() { - alt self.rep { + match self.rep { small(b) => b.clear(), big(s) => for s.each_storage() |w| { w = 0u } } @@ -302,7 +302,7 @@ class bitv { /// Set all bits to 1 #[inline(always)] fn set_all() { - alt self.rep { + match self.rep { small(b) => b.set_all(), big(s) => for s.each_storage() |w| { w = !0u } } } @@ -310,7 +310,7 @@ class bitv { /// Invert all bits #[inline(always)] fn invert() { - alt self.rep { + match self.rep { small(b) => b.invert(), big(s) => for s.each_storage() |w| { w = !w } } } @@ -329,7 +329,7 @@ class bitv { /// Returns true if all bits are 1 #[inline(always)] fn is_true() -> bool { - alt self.rep { + match self.rep { small(b) => b.is_true(), _ => { for self.each() |i| { if !i { return false; } } @@ -350,7 +350,7 @@ class bitv { /// Returns true if all bits are 0 fn is_false() -> bool { - alt self.rep { + match self.rep { small(b) => b.is_false(), big(_) => { for self.each() |i| { if i { return false; } } |
