@@ -120,8 +120,6 @@ impl <K: Ord, V> TreeMap<K, V> {
120
120
/// Create an empty TreeMap
121
121
static pure fn new( ) -> TreeMap < K , V > { TreeMap { root : None , length : 0 } }
122
122
123
- /// Return true if the map contains some elements
124
- pure fn is_not_empty( & self ) -> bool { self . root. is_some( ) }
125
123
126
124
/// Visit all key-value pairs in reverse order
127
125
pure fn each_reverse( & self , f: fn ( & K , & V ) -> bool) {
@@ -176,7 +174,7 @@ impl <K: Ord, V> TreeMapIterator<K, V> {
176
174
/// tuple with a reference to the key and value. If there are no
177
175
/// more nodes, return `None`.
178
176
fn next ( & mut self ) -> Option < ( & self /K , & self /V ) > {
179
- while self . stack . is_not_empty ( ) || self . node . is_some ( ) {
177
+ while ! self . stack . is_empty ( ) || self . node . is_some ( ) {
180
178
match * self . node {
181
179
Some ( ref x) => {
182
180
self . stack . push ( x) ;
@@ -240,9 +238,6 @@ impl <T: Ord> TreeSet<T> {
240
238
/// Create an empty TreeSet
241
239
static pure fn new( ) -> TreeSet <T > { TreeSet { map: TreeMap :: new( ) } }
242
240
243
- /// Return true if the set contains some elements
244
- pure fn is_not_empty ( & self ) -> bool { self . map . is_not_empty ( ) }
245
-
246
241
/// Visit all values in reverse order
247
242
pure fn each_reverse ( & self , f : fn ( & T ) -> bool ) {
248
243
self . map . each_key_reverse ( f)
@@ -675,7 +670,6 @@ mod test_treemap {
675
670
676
671
fn check_equal<K : Eq Ord , V : Eq >( ctrl: & [ ( K , V ) ] , map: & TreeMap <K , V >) {
677
672
assert ctrl. is_empty( ) == map. is_empty( ) ;
678
- assert ctrl. is_not_empty( ) == map. is_not_empty( ) ;
679
673
for ctrl. each |x| {
680
674
let & ( k, v) = x;
681
675
assert map. find( & k) . unwrap( ) == & v
0 commit comments