|
16 | 16 | #[allow(missing_doc)];
|
17 | 17 |
|
18 | 18 | use std::iterator::{Iterator, IteratorUtil, Enumerate, FilterMap, Invert};
|
19 |
| -use std::uint; |
20 | 19 | use std::util::replace;
|
21 | 20 | use std::vec::{VecIterator, VecMutIterator};
|
22 | 21 | use std::vec;
|
@@ -116,48 +115,6 @@ impl<V> SmallIntMap<V> {
|
116 | 115 | /// Create an empty SmallIntMap
|
117 | 116 | pub fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} }
|
118 | 117 |
|
119 |
| - /// Visit all key-value pairs in order |
120 |
| - pub fn each<'a>(&'a self, it: &fn(&uint, &'a V) -> bool) -> bool { |
121 |
| - for i in range(0u, self.v.len()) { |
122 |
| - match self.v[i] { |
123 |
| - Some(ref elt) => if !it(&i, elt) { return false; }, |
124 |
| - None => () |
125 |
| - } |
126 |
| - } |
127 |
| - true |
128 |
| - } |
129 |
| - |
130 |
| - /// Visit all keys in order |
131 |
| - pub fn each_key(&self, blk: &fn(key: &uint) -> bool) -> bool { |
132 |
| - self.each(|k, _| blk(k)) |
133 |
| - } |
134 |
| - |
135 |
| - /// Visit all values in order |
136 |
| - pub fn each_value<'a>(&'a self, blk: &fn(value: &'a V) -> bool) -> bool { |
137 |
| - self.each(|_, v| blk(v)) |
138 |
| - } |
139 |
| - |
140 |
| - /// Iterate over the map and mutate the contained values |
141 |
| - pub fn mutate_values(&mut self, it: &fn(&uint, &mut V) -> bool) -> bool { |
142 |
| - for i in range(0, self.v.len()) { |
143 |
| - match self.v[i] { |
144 |
| - Some(ref mut elt) => if !it(&i, elt) { return false; }, |
145 |
| - None => () |
146 |
| - } |
147 |
| - } |
148 |
| - true |
149 |
| - } |
150 |
| - |
151 |
| - /// Visit all key-value pairs in reverse order |
152 |
| - pub fn each_reverse<'a>(&'a self, it: &fn(uint, &'a V) -> bool) -> bool { |
153 |
| - do uint::range_rev(self.v.len(), 0) |i| { |
154 |
| - match self.v[i] { |
155 |
| - Some(ref elt) => it(i, elt), |
156 |
| - None => true |
157 |
| - } |
158 |
| - } |
159 |
| - } |
160 |
| - |
161 | 118 | pub fn get<'a>(&'a self, key: &uint) -> &'a V {
|
162 | 119 | self.find(key).expect("key not present")
|
163 | 120 | }
|
|
0 commit comments