Skip to content

Commit 6a46651

Browse files
blake2-ppcthestinger
authored andcommitted
---
yaml --- r: 66157 b: refs/heads/master c: 13f666a h: refs/heads/master i: 66155: fc27c47 v: v3
1 parent b4172ba commit 6a46651

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f045210857a8936c7d6ce36a3029eac906dedc4e
2+
refs/heads/master: 13f666a72468ad20d5145ff5d618ef31c479c1a2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libstd/hashmap.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use container::{Container, Mutable, Map, Set};
1919
use cmp::{Eq, Equiv};
2020
use hash::Hash;
21-
use old_iter::BaseIter;
2221
use iterator::{Iterator, IteratorUtil};
2322
use option::{None, Option, Some};
2423
use rand::RngUtil;
@@ -622,12 +621,6 @@ pub struct HashSet<T> {
622621
priv map: HashMap<T, ()>
623622
}
624623

625-
impl<T:Hash + Eq> BaseIter<T> for HashSet<T> {
626-
/// Visit all values in order
627-
fn each(&self, f: &fn(&T) -> bool) -> bool { self.map.each_key(f) }
628-
fn size_hint(&self) -> Option<uint> { Some(self.len()) }
629-
}
630-
631624
impl<T:Hash + Eq> Eq for HashSet<T> {
632625
fn eq(&self, other: &HashSet<T>) -> bool { self.map == other.map }
633626
fn ne(&self, other: &HashSet<T>) -> bool { self.map != other.map }
@@ -725,6 +718,12 @@ impl<T:Hash + Eq> HashSet<T> {
725718
self.map.contains_key_equiv(value)
726719
}
727720

721+
/// Visit all elements in arbitrary order
722+
/// FIXME: Remove when all callers are converted
723+
pub fn each(&self, f: &fn(&T) -> bool) -> bool {
724+
self.iter().advance(f)
725+
}
726+
728727
/// An iterator visiting all elements in arbitrary order.
729728
/// Iterator element type is &'a T.
730729
pub fn iter<'a>(&'a self) -> HashSetIterator<'a, T> {

0 commit comments

Comments
 (0)