std::trie: remove each_{key,value}_reverse internal iterators.

This are *trivial* to reimplement in terms of each_reverse if that extra
little bit of performance is needed.
This commit is contained in:
Huon Wilson 2014-01-12 21:35:12 +11:00
parent aa67e13498
commit f0c554d0d8

View file

@ -111,18 +111,6 @@ impl<T> TrieMap<T> {
self.root.each_reverse(f)
}
/// Visit all keys in reverse order
#[inline]
pub fn each_key_reverse(&self, f: |&uint| -> bool) -> bool {
self.each_reverse(|k, _| f(k))
}
/// Visit all values in reverse order
#[inline]
pub fn each_value_reverse(&self, f: |&T| -> bool) -> bool {
self.each_reverse(|_, v| f(v))
}
/// Get an iterator over the key-value pairs in the map
pub fn iter<'a>(&'a self) -> TrieMapIterator<'a, T> {
TrieMapIterator {
@ -328,7 +316,7 @@ impl TrieSet {
/// Visit all values in reverse order
#[inline]
pub fn each_reverse(&self, f: |&uint| -> bool) -> bool {
self.map.each_key_reverse(f)
self.map.each_reverse(|k, _| f(k))
}
/// Get an iterator over the values in the set