Skip to content

Commit e33fcf9

Browse files
committed
extra::treemap: remove mutate_values, replaced by .mut_iter().
1 parent 463a6d9 commit e33fcf9

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/libextra/treemap.rs

-23
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@ impl<K: TotalOrd, V> TreeMap<K, V> {
135135
/// Create an empty TreeMap
136136
pub fn new() -> TreeMap<K, V> { TreeMap{root: None, length: 0} }
137137

138-
/// Iterate over the map and mutate the contained values
139-
pub fn mutate_values(&mut self, f: |&K, &mut V| -> bool) -> bool {
140-
mutate_values(&mut self.root, f)
141-
}
142-
143138
/// Get a lazy iterator over the key-value pairs in the map.
144139
/// Requires that it be frozen (immutable).
145140
pub fn iter<'a>(&'a self) -> TreeMapIterator<'a, K, V> {
@@ -892,24 +887,6 @@ impl<K: TotalOrd, V> TreeNode<K, V> {
892887
}
893888
}
894889

895-
fn mutate_values<'r,
896-
K:TotalOrd,
897-
V>(
898-
node: &'r mut Option<~TreeNode<K,V>>,
899-
f: |&'r K, &'r mut V| -> bool)
900-
-> bool {
901-
match *node {
902-
Some(~TreeNode{key: ref key, value: ref mut value, left: ref mut left,
903-
right: ref mut right, ..}) => {
904-
if !mutate_values(left, |k,v| f(k,v)) { return false }
905-
if !f(key, value) { return false }
906-
if !mutate_values(right, |k,v| f(k,v)) { return false }
907-
}
908-
None => return false
909-
}
910-
true
911-
}
912-
913890
// Remove left horizontal link by rotating right
914891
fn skew<K: TotalOrd, V>(node: &mut ~TreeNode<K, V>) {
915892
if node.left.as_ref().map_default(false, |x| x.level == node.level) {

0 commit comments

Comments
 (0)