Replace init() with uninit() where appropriate
This commit is contained in:
@@ -139,7 +139,7 @@ pub impl <T:Ord> PriorityQueue<T> {
|
||||
while pos > start {
|
||||
let parent = (pos - 1) >> 1;
|
||||
if new > self.data[parent] {
|
||||
let mut x = rusti::init();
|
||||
let mut x = rusti::uninit();
|
||||
x <-> self.data[parent];
|
||||
rusti::move_val_init(&mut self.data[pos], x);
|
||||
pos = parent;
|
||||
@@ -162,7 +162,7 @@ pub impl <T:Ord> PriorityQueue<T> {
|
||||
if right < end && !(self.data[child] > self.data[right]) {
|
||||
child = right;
|
||||
}
|
||||
let mut x = rusti::init();
|
||||
let mut x = rusti::uninit();
|
||||
x <-> self.data[child];
|
||||
rusti::move_val_init(&mut self.data[pos], x);
|
||||
pos = child;
|
||||
|
||||
@@ -51,7 +51,7 @@ impl<T: Owned> Drop for Rc<T> {
|
||||
unsafe {
|
||||
(*self.ptr).count -= 1;
|
||||
if (*self.ptr).count == 0 {
|
||||
let mut x = intrinsics::init();
|
||||
let mut x = intrinsics::uninit();
|
||||
x <-> *self.ptr;
|
||||
free(self.ptr as *c_void)
|
||||
}
|
||||
@@ -159,7 +159,7 @@ impl<T: Owned> Drop for RcMut<T> {
|
||||
unsafe {
|
||||
(*self.ptr).count -= 1;
|
||||
if (*self.ptr).count == 0 {
|
||||
let mut x = rusti::init();
|
||||
let mut x = rusti::uninit();
|
||||
x <-> *self.ptr;
|
||||
free(self.ptr as *c_void)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user