Skip to content

Commit 2002d46

Browse files
sfackleralexcrichton
authored andcommitted
---
yaml --- r: 150822 b: refs/heads/try2 c: 06edc6a h: refs/heads/master v: v3
1 parent 3e6d4cf commit 2002d46

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c7325bdd8e29d57e7bc971b86accfb352c4262bc
8+
refs/heads/try2: 06edc6a3b6ba23832530e6c0d4727cbcdcfb8a0d
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcollections/treemap.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -64,32 +64,20 @@ fn lt<K: Ord + TotalOrd, V: Ord>(a: &TreeMap<K, V>,
6464
impl<K: Ord + TotalOrd, V: Ord> Ord for TreeMap<K, V> {
6565
#[inline]
6666
fn lt(&self, other: &TreeMap<K, V>) -> bool { lt(self, other) }
67-
#[inline]
68-
fn le(&self, other: &TreeMap<K, V>) -> bool { !lt(other, self) }
69-
#[inline]
70-
fn ge(&self, other: &TreeMap<K, V>) -> bool { !lt(self, other) }
71-
#[inline]
72-
fn gt(&self, other: &TreeMap<K, V>) -> bool { lt(other, self) }
7367
}
7468

7569
impl<K: TotalOrd, V> Container for TreeMap<K, V> {
76-
/// Return the number of elements in the map
7770
fn len(&self) -> uint { self.length }
78-
79-
/// Return true if the map contains no elements
80-
fn is_empty(&self) -> bool { self.root.is_none() }
8171
}
8272

8373
impl<K: TotalOrd, V> Mutable for TreeMap<K, V> {
84-
/// Clear the map, removing all key-value pairs.
8574
fn clear(&mut self) {
8675
self.root = None;
8776
self.length = 0
8877
}
8978
}
9079

9180
impl<K: TotalOrd, V> Map<K, V> for TreeMap<K, V> {
92-
/// Return a reference to the value corresponding to the key
9381
fn find<'a>(&'a self, key: &K) -> Option<&'a V> {
9482
let mut current: &'a Option<~TreeNode<K, V>> = &self.root;
9583
loop {
@@ -108,22 +96,17 @@ impl<K: TotalOrd, V> Map<K, V> for TreeMap<K, V> {
10896
}
10997

11098
impl<K: TotalOrd, V> MutableMap<K, V> for TreeMap<K, V> {
111-
/// Return a mutable reference to the value corresponding to the key
11299
#[inline]
113100
fn find_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V> {
114101
find_mut(&mut self.root, key)
115102
}
116103

117-
/// Insert a key-value pair from the map. If the key already had a value
118-
/// present in the map, that value is returned. Otherwise None is returned.
119104
fn swap(&mut self, key: K, value: V) -> Option<V> {
120105
let ret = insert(&mut self.root, key, value);
121106
if ret.is_none() { self.length += 1 }
122107
ret
123108
}
124109

125-
/// Removes a key from the map, returning the value at the key if the key
126-
/// was previously in the map.
127110
fn pop(&mut self, key: &K) -> Option<V> {
128111
let ret = remove(&mut self.root, key);
129112
if ret.is_some() { self.length -= 1 }
@@ -531,15 +514,13 @@ impl<K, V> Iterator<(K, V)> for MoveEntries<K,V> {
531514
}
532515

533516
impl<'a, T> Iterator<&'a T> for SetItems<'a, T> {
534-
/// Advance the iterator to the next node (in order). If there are no more nodes, return `None`.
535517
#[inline]
536518
fn next(&mut self) -> Option<&'a T> {
537519
self.iter.next().map(|(value, _)| value)
538520
}
539521
}
540522

541523
impl<'a, T> Iterator<&'a T> for RevSetItems<'a, T> {
542-
/// Advance the iterator to the next node (in order). If there are no more nodes, return `None`.
543524
#[inline]
544525
fn next(&mut self) -> Option<&'a T> {
545526
self.iter.next().map(|(value, _)| value)
@@ -557,19 +538,11 @@ pub struct TreeSet<T> {
557538
impl<T: Eq + TotalOrd> Eq for TreeSet<T> {
558539
#[inline]
559540
fn eq(&self, other: &TreeSet<T>) -> bool { self.map == other.map }
560-
#[inline]
561-
fn ne(&self, other: &TreeSet<T>) -> bool { self.map != other.map }
562541
}
563542

564543
impl<T: Ord + TotalOrd> Ord for TreeSet<T> {
565544
#[inline]
566545
fn lt(&self, other: &TreeSet<T>) -> bool { self.map < other.map }
567-
#[inline]
568-
fn le(&self, other: &TreeSet<T>) -> bool { self.map <= other.map }
569-
#[inline]
570-
fn ge(&self, other: &TreeSet<T>) -> bool { self.map >= other.map }
571-
#[inline]
572-
fn gt(&self, other: &TreeSet<T>) -> bool { self.map > other.map }
573546
}
574547

575548
impl<T: TotalOrd> Container for TreeSet<T> {

0 commit comments

Comments
 (0)