Skip to content

Commit 74d938c

Browse files
committed
---
yaml --- r: 42670 b: refs/heads/try c: ca8f09a h: refs/heads/master v: v3
1 parent eb4ad3a commit 74d938c

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5-
refs/heads/try: aff3db26aa6e427b68fea577548a270cacdd0153
5+
refs/heads/try: ca8f09a39e49b47c0116ad0f2dcb13d9c450faa6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/libstd/priority_queue.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ impl <T: Ord> PriorityQueue<T> {
7676
}
7777

7878
/// Optimized version of a push followed by a pop
79-
fn push_pop(&mut self, item: T) -> T {
80-
let mut item = item;
79+
fn push_pop(&mut self, mut item: T) -> T {
8180
if !self.is_empty() && self.data[0] > item {
8281
item <-> self.data[0];
8382
self.siftdown(0);
@@ -86,8 +85,7 @@ impl <T: Ord> PriorityQueue<T> {
8685
}
8786

8887
/// Optimized version of a pop followed by a push - fails if empty
89-
fn replace(&mut self, item: T) -> T {
90-
let mut item = item;
88+
fn replace(&mut self, mut item: T) -> T {
9189
item <-> self.data[0];
9290
self.siftdown(0);
9391
item
@@ -129,9 +127,8 @@ impl <T: Ord> PriorityQueue<T> {
129127
// vector over the junk element. This reduces the constant factor
130128
// compared to using swaps, which involves twice as many moves.
131129

132-
priv fn siftup(&mut self, start: uint, pos: uint) {
130+
priv fn siftup(&mut self, start: uint, mut pos: uint) {
133131
unsafe {
134-
let mut pos = pos;
135132
let new = move *addr_of(&self.data[pos]);
136133

137134
while pos > start {
@@ -149,9 +146,8 @@ impl <T: Ord> PriorityQueue<T> {
149146
}
150147
}
151148

152-
priv fn siftdown_range(&mut self, pos: uint, end: uint) {
149+
priv fn siftdown_range(&mut self, mut pos: uint, end: uint) {
153150
unsafe {
154-
let mut pos = pos;
155151
let start = pos;
156152
let new = move *addr_of(&self.data[pos]);
157153

0 commit comments

Comments
 (0)