Skip to content

Commit 96a150f

Browse files
author
blake2-ppc
committed
extra: Remove all .each methods in smallintmap
1 parent 54c8c23 commit 96a150f

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

src/libextra/smallintmap.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#[allow(missing_doc)];
1717

1818
use std::iterator::{Iterator, IteratorUtil, Enumerate, FilterMap, Invert};
19-
use std::uint;
2019
use std::util::replace;
2120
use std::vec::{VecIterator, VecMutIterator};
2221
use std::vec;
@@ -116,48 +115,6 @@ impl<V> SmallIntMap<V> {
116115
/// Create an empty SmallIntMap
117116
pub fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} }
118117

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-
161118
pub fn get<'a>(&'a self, key: &uint) -> &'a V {
162119
self.find(key).expect("key not present")
163120
}

0 commit comments

Comments
 (0)