Skip to content

Commit 6674ba2

Browse files
committed
---
yaml --- r: 53880 b: refs/heads/dist-snap c: 2b6614f h: refs/heads/master v: v3
1 parent ecf1e4b commit 6674ba2

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
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 88278f9c353b36762adbe4f67078f681a756b752
10+
refs/heads/dist-snap: 2b6614f2e610e1bfdd45c236dd071a72673980c8
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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)