Skip to content

Commit 599cbb2

Browse files
committed
---
yaml --- r: 139029 b: refs/heads/try2 c: 2b6614f h: refs/heads/master i: 139027: bb85426 v: v3
1 parent 6f39e6d commit 599cbb2

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
@@ -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: 88278f9c353b36762adbe4f67078f681a756b752
8+
refs/heads/try2: 2b6614f2e610e1bfdd45c236dd071a72673980c8
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/treemap.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,13 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
636636
fn heir_swap<K: TotalOrd, V>(node: &mut ~TreeNode<K, V>,
637637
child: &mut Option<~TreeNode<K, V>>) {
638638
// *could* be done without recursion, but it won't borrow check
639-
do child.mutate |mut child| {
640-
if child.right.is_some() {
641-
heir_swap(node, &mut child.right);
639+
for child.each_mut |x| {
640+
if x.right.is_some() {
641+
heir_swap(node, &mut x.right);
642642
} else {
643-
node.key <-> child.key;
644-
node.value <-> child.value;
643+
node.key <-> x.key;
644+
node.value <-> x.value;
645645
}
646-
child
647646
}
648647
}
649648

@@ -689,7 +688,7 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
689688
save.level -= 1;
690689

691690
if right_level > save.level {
692-
do save.right.mutate |mut x| { x.level = save.level; x }
691+
for save.right.each_mut |x| { x.level = save.level }
693692
}
694693

695694
skew(save);

0 commit comments

Comments
 (0)