@@ -135,11 +135,6 @@ impl<K: TotalOrd, V> TreeMap<K, V> {
135
135
/// Create an empty TreeMap
136
136
pub fn new ( ) -> TreeMap < K , V > { TreeMap { root : None , length : 0 } }
137
137
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
-
143
138
/// Get a lazy iterator over the key-value pairs in the map.
144
139
/// Requires that it be frozen (immutable).
145
140
pub fn iter < ' a > ( & ' a self ) -> TreeMapIterator < ' a , K , V > {
@@ -892,24 +887,6 @@ impl<K: TotalOrd, V> TreeNode<K, V> {
892
887
}
893
888
}
894
889
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
-
913
890
// Remove left horizontal link by rotating right
914
891
fn skew < K : TotalOrd , V > ( node : & mut ~TreeNode < K , V > ) {
915
892
if node. left . as_ref ( ) . map_default ( false , |x| x. level == node. level ) {
0 commit comments