Replace init() with uninit() where appropriate

This commit is contained in:
James Miller
2013-05-09 22:41:26 +12:00
parent 050c744c23
commit f5ab112e6b
4 changed files with 9 additions and 14 deletions

View File

@@ -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;

View File

@@ -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)
}