Skip to content

Commit c2fadaf

Browse files
blake2-ppcthestinger
authored andcommitted
---
yaml --- r: 63575 b: refs/heads/snap-stage3 c: f045210 h: refs/heads/master i: 63573: 7a3004c 63571: 8d96a01 63567: af8b7c3 v: v3
1 parent c8a007b commit c2fadaf

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 3af1d20bea80faaf5fe14a56c94e8e7337691e0d
4+
refs/heads/snap-stage3: f045210857a8936c7d6ce36a3029eac906dedc4e
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/hashmap.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use container::{Container, Mutable, Map, Set};
1919
use cmp::{Eq, Equiv};
2020
use hash::Hash;
2121
use old_iter::BaseIter;
22-
use old_iter;
2322
use iterator::{Iterator, IteratorUtil};
2423
use option::{None, Option, Some};
2524
use rand::RngUtil;
@@ -548,7 +547,7 @@ impl<K:Hash + Eq,V:Eq> Eq for HashMap<K, V> {
548547
fn eq(&self, other: &HashMap<K, V>) -> bool {
549548
if self.len() != other.len() { return false; }
550549

551-
for self.each |key, value| {
550+
for self.iter().advance |(key, value)| {
552551
match other.find(key) {
553552
None => return false,
554553
Some(v) => if value != v { return false },
@@ -662,12 +661,12 @@ impl<T:Hash + Eq> Set<T> for HashSet<T> {
662661
/// Return true if the set has no elements in common with `other`.
663662
/// This is equivalent to checking for an empty intersection.
664663
fn is_disjoint(&self, other: &HashSet<T>) -> bool {
665-
old_iter::all(self, |v| !other.contains(v))
664+
self.iter().all(|v| !other.contains(v))
666665
}
667666

668667
/// Return true if the set is a subset of another
669668
fn is_subset(&self, other: &HashSet<T>) -> bool {
670-
old_iter::all(self, |v| other.contains(v))
669+
self.iter().all(|v| other.contains(v))
671670
}
672671

673672
/// Return true if the set is a superset of another
@@ -677,7 +676,7 @@ impl<T:Hash + Eq> Set<T> for HashSet<T> {
677676

678677
/// Visit the values representing the difference
679678
fn difference(&self, other: &HashSet<T>, f: &fn(&T) -> bool) -> bool {
680-
self.each(|v| other.contains(v) || f(v))
679+
self.iter().advance(|v| other.contains(v) || f(v))
681680
}
682681

683682
/// Visit the values representing the symmetric difference
@@ -689,12 +688,12 @@ impl<T:Hash + Eq> Set<T> for HashSet<T> {
689688

690689
/// Visit the values representing the intersection
691690
fn intersection(&self, other: &HashSet<T>, f: &fn(&T) -> bool) -> bool {
692-
self.each(|v| !other.contains(v) || f(v))
691+
self.iter().advance(|v| !other.contains(v) || f(v))
693692
}
694693

695694
/// Visit the values representing the union
696695
fn union(&self, other: &HashSet<T>, f: &fn(&T) -> bool) -> bool {
697-
self.each(f) && other.each(|v| self.contains(v) || f(v))
696+
self.iter().advance(f) && other.iter().advance(|v| self.contains(v) || f(v))
698697
}
699698
}
700699

@@ -875,7 +874,7 @@ mod test_map {
875874
assert!(m.insert(i, i*2));
876875
}
877876
let mut observed = 0;
878-
for m.each |k, v| {
877+
for m.iter().advance |(k, v)| {
879878
assert_eq!(*v, *k * 2);
880879
observed |= (1 << *k);
881880
}

0 commit comments

Comments
 (0)