libstd: Get rid of move
.
This commit is contained in:
parent
9727008ed0
commit
4cf51c2531
31 changed files with 357 additions and 363 deletions
|
@ -139,27 +139,27 @@ impl <T: Ord> PriorityQueue<T> {
|
|||
|
||||
priv fn siftup(&mut self, start: uint, mut pos: uint) {
|
||||
unsafe {
|
||||
let new = move *addr_of(&self.data[pos]);
|
||||
let new = *addr_of(&self.data[pos]);
|
||||
|
||||
while pos > start {
|
||||
let parent = (pos - 1) >> 1;
|
||||
if new > self.data[parent] {
|
||||
let mut x = rusti::init();
|
||||
x <-> self.data[parent];
|
||||
rusti::move_val_init(&mut self.data[pos], move x);
|
||||
rusti::move_val_init(&mut self.data[pos], x);
|
||||
pos = parent;
|
||||
loop
|
||||
}
|
||||
break
|
||||
}
|
||||
rusti::move_val_init(&mut self.data[pos], move new);
|
||||
rusti::move_val_init(&mut self.data[pos], new);
|
||||
}
|
||||
}
|
||||
|
||||
priv fn siftdown_range(&mut self, mut pos: uint, end: uint) {
|
||||
unsafe {
|
||||
let start = pos;
|
||||
let new = move *addr_of(&self.data[pos]);
|
||||
let new = *addr_of(&self.data[pos]);
|
||||
|
||||
let mut child = 2 * pos + 1;
|
||||
while child < end {
|
||||
|
@ -169,12 +169,12 @@ impl <T: Ord> PriorityQueue<T> {
|
|||
}
|
||||
let mut x = rusti::init();
|
||||
x <-> self.data[child];
|
||||
rusti::move_val_init(&mut self.data[pos], move x);
|
||||
rusti::move_val_init(&mut self.data[pos], x);
|
||||
pos = child;
|
||||
child = 2 * pos + 1;
|
||||
}
|
||||
|
||||
rusti::move_val_init(&mut self.data[pos], move new);
|
||||
rusti::move_val_init(&mut self.data[pos], new);
|
||||
self.siftup(start, pos);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue