libstd: Fix merge fallout.
This commit is contained in:
parent
db0693ac8d
commit
58a37a1f48
2 changed files with 14 additions and 10 deletions
|
@ -128,18 +128,20 @@ pub fn _eachi<A,IA:BaseIter<A>>(this: &IA, blk: &fn(uint, &A) -> bool) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
#[cfg(stage0)]
|
||||||
pub fn eachi<A,IA:BaseIter<A>>(self: &IA, blk: &fn(uint, &A) -> bool) {
|
pub fn eachi<A,IA:BaseIter<A>>(this: &IA, blk: &fn(uint, &A) -> bool) {
|
||||||
_eachi(self, blk);
|
_eachi(this, blk);
|
||||||
}
|
}
|
||||||
#[cfg(not(stage0))]
|
#[cfg(not(stage0))]
|
||||||
pub fn eachi<A,IA:BaseIter<A>>(self: &IA, blk: &fn(uint, &A) -> bool) -> bool {
|
pub fn eachi<A,IA:BaseIter<A>>(this: &IA, blk: &fn(uint, &A) -> bool) -> bool {
|
||||||
_eachi(self, blk)
|
_eachi(this, blk)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn all<A,IA:BaseIter<A>>(this: &IA, blk: &fn(&A) -> bool) -> bool {
|
pub fn all<A,IA:BaseIter<A>>(this: &IA, blk: &fn(&A) -> bool) -> bool {
|
||||||
for this.each |a| {
|
for this.each |a| {
|
||||||
if !blk(a) { return false; }
|
if !blk(a) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -147,7 +149,9 @@ pub fn all<A,IA:BaseIter<A>>(this: &IA, blk: &fn(&A) -> bool) -> bool {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn any<A,IA:BaseIter<A>>(this: &IA, blk: &fn(&A) -> bool) -> bool {
|
pub fn any<A,IA:BaseIter<A>>(this: &IA, blk: &fn(&A) -> bool) -> bool {
|
||||||
for this.each |a| {
|
for this.each |a| {
|
||||||
if blk(a) { return true; }
|
if blk(a) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ pub impl <T:Ord> PriorityQueue<T> {
|
||||||
while pos > start {
|
while pos > start {
|
||||||
let parent = (pos - 1) >> 1;
|
let parent = (pos - 1) >> 1;
|
||||||
if new > self.data[parent] {
|
if new > self.data[parent] {
|
||||||
let x = replace(&mut self.data[parent], rusti::uninit());
|
let x = replace(&mut self.data[parent], uninit());
|
||||||
move_val_init(&mut self.data[pos], x);
|
move_val_init(&mut self.data[pos], x);
|
||||||
pos = parent;
|
pos = parent;
|
||||||
loop
|
loop
|
||||||
|
@ -172,7 +172,7 @@ pub impl <T:Ord> PriorityQueue<T> {
|
||||||
while pos > start {
|
while pos > start {
|
||||||
let parent = (pos - 1) >> 1;
|
let parent = (pos - 1) >> 1;
|
||||||
if new > self.data[parent] {
|
if new > self.data[parent] {
|
||||||
let x = replace(&mut self.data[parent], rusti::init());
|
let x = replace(&mut self.data[parent], init());
|
||||||
move_val_init(&mut self.data[pos], x);
|
move_val_init(&mut self.data[pos], x);
|
||||||
pos = parent;
|
pos = parent;
|
||||||
loop
|
loop
|
||||||
|
@ -196,7 +196,7 @@ pub impl <T:Ord> PriorityQueue<T> {
|
||||||
if right < end && !(self.data[child] > self.data[right]) {
|
if right < end && !(self.data[child] > self.data[right]) {
|
||||||
child = right;
|
child = right;
|
||||||
}
|
}
|
||||||
let x = replace(&mut self.data[child], rusti::uninit());
|
let x = replace(&mut self.data[child], uninit());
|
||||||
move_val_init(&mut self.data[pos], x);
|
move_val_init(&mut self.data[pos], x);
|
||||||
pos = child;
|
pos = child;
|
||||||
child = 2 * pos + 1;
|
child = 2 * pos + 1;
|
||||||
|
@ -219,7 +219,7 @@ pub impl <T:Ord> PriorityQueue<T> {
|
||||||
if right < end && !(self.data[child] > self.data[right]) {
|
if right < end && !(self.data[child] > self.data[right]) {
|
||||||
child = right;
|
child = right;
|
||||||
}
|
}
|
||||||
let x = replace(&mut self.data[child], rusti::init());
|
let x = replace(&mut self.data[child], init());
|
||||||
move_val_init(&mut self.data[pos], x);
|
move_val_init(&mut self.data[pos], x);
|
||||||
pos = child;
|
pos = child;
|
||||||
child = 2 * pos + 1;
|
child = 2 * pos + 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue