diff options
| author | bors <bors@rust-lang.org> | 2013-02-12 10:35:12 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-02-12 10:35:12 -0800 |
| commit | 210fa2d0172c10112196e8fcf640e32ee54944fe (patch) | |
| tree | 6cafd04f544999faab963bfe9b00d45a61393603 /src/libstd | |
| parent | 1c487b18f3ff2ea55e377c3e8be99227c8257136 (diff) | |
| parent | 99ff74c1bd4d982cfc49f8ed962cd31f3c8d9ae7 (diff) | |
| download | rust-210fa2d0172c10112196e8fcf640e32ee54944fe.tar.gz rust-210fa2d0172c10112196e8fcf640e32ee54944fe.zip | |
auto merge of #4874 : thestinger/rust/option, r=catamorphism
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/treemap.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs index d3583828f9a..26bf232adf5 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -561,18 +561,18 @@ impl <K: Ord, V> TreeNode<K, V> { pure fn each<K: Ord, V>(node: &r/Option<~TreeNode<K, V>>, f: fn(&(&r/K, &r/V)) -> bool) { - do node.map |x| { + do node.iter |x| { each(&x.left, f); if f(&(&x.key, &x.value)) { each(&x.right, f) } - }; + } } pure fn each_reverse<K: Ord, V>(node: &r/Option<~TreeNode<K, V>>, f: fn(&(&r/K, &r/V)) -> bool) { - do node.map |x| { + do node.iter |x| { each_reverse(&x.right, f); if f(&(&x.key, &x.value)) { each_reverse(&x.left, f) } - }; + } } // Remove left horizontal link by rotating right |
