diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-04-17 18:05:17 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-04-30 06:43:02 -0400 |
| commit | 202b8dcdc420d8b109fbd5260ea2e2be0a5b7faf (patch) | |
| tree | e83d223715ffe4b842f3a46b274b31ee3655ec50 /src/libstd/smallintmap.rs | |
| parent | c081ffbd1e845687202a975ea2e698b623e5722f (diff) | |
| download | rust-202b8dcdc420d8b109fbd5260ea2e2be0a5b7faf.tar.gz rust-202b8dcdc420d8b109fbd5260ea2e2be0a5b7faf.zip | |
adapt to snapshot
Diffstat (limited to 'src/libstd/smallintmap.rs')
| -rw-r--r-- | src/libstd/smallintmap.rs | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs index fb17d4e5090..1b72300a178 100644 --- a/src/libstd/smallintmap.rs +++ b/src/libstd/smallintmap.rs @@ -50,20 +50,6 @@ impl<V> Map<uint, V> for SmallIntMap<V> { } /// Visit all key-value pairs in order - #[cfg(stage0)] - fn each(&self, it: &fn(&uint, &'self V) -> bool) { - for uint::range(0, self.v.len()) |i| { - match self.v[i] { - Some(ref elt) => if !it(&i, elt) { break }, - None => () - } - } - } - - /// Visit all key-value pairs in order - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] fn each<'a>(&'a self, it: &fn(&uint, &'a V) -> bool) { for uint::range(0, self.v.len()) |i| { match self.v[i] { @@ -79,15 +65,6 @@ impl<V> Map<uint, V> for SmallIntMap<V> { } /// Visit all values in order - #[cfg(stage0)] - fn each_value(&self, blk: &fn(value: &V) -> bool) { - self.each(|_, v| blk(v)) - } - - /// Visit all values in order - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] fn each_value<'a>(&'a self, blk: &fn(value: &'a V) -> bool) { self.each(|_, v| blk(v)) } @@ -103,22 +80,6 @@ impl<V> Map<uint, V> for SmallIntMap<V> { } /// Return a reference to the value corresponding to the key - #[cfg(stage0)] - fn find(&self, key: &uint) -> Option<&'self V> { - if *key < self.v.len() { - match self.v[*key] { - Some(ref value) => Some(value), - None => None - } - } else { - None - } - } - - /// Return a reference to the value corresponding to the key - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] fn find<'a>(&'a self, key: &uint) -> Option<&'a V> { if *key < self.v.len() { match self.v[*key] { @@ -131,22 +92,6 @@ impl<V> Map<uint, V> for SmallIntMap<V> { } /// Return a mutable reference to the value corresponding to the key - #[cfg(stage0)] - fn find_mut(&mut self, key: &uint) -> Option<&'self mut V> { - if *key < self.v.len() { - match self.v[*key] { - Some(ref mut value) => Some(value), - None => None - } - } else { - None - } - } - - /// Return a mutable reference to the value corresponding to the key - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] fn find_mut<'a>(&'a mut self, key: &uint) -> Option<&'a mut V> { if *key < self.v.len() { match self.v[*key] { @@ -188,20 +133,6 @@ pub impl<V> SmallIntMap<V> { fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} } /// Visit all key-value pairs in reverse order - #[cfg(stage0)] - fn each_reverse(&self, it: &fn(uint, &'self V) -> bool) { - for uint::range_rev(self.v.len(), 0) |i| { - match self.v[i - 1] { - Some(ref elt) => if !it(i - 1, elt) { break }, - None => () - } - } - } - - /// Visit all key-value pairs in reverse order - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] fn each_reverse<'a>(&'a self, it: &fn(uint, &'a V) -> bool) { for uint::range_rev(self.v.len(), 0) |i| { match self.v[i - 1] { @@ -211,14 +142,6 @@ pub impl<V> SmallIntMap<V> { } } - #[cfg(stage0)] - fn get(&self, key: &uint) -> &'self V { - self.find(key).expect("key not present") - } - - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] fn get<'a>(&'a self, key: &uint) -> &'a V { self.find(key).expect("key not present") } |
