Skip to content

Commit 0075c27

Browse files
committed
vec: minor cleanup
1 parent b74208b commit 0075c27

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libcollections/vec.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ impl<T> MutableSeq<T> for Vec<T> {
17341734
let size = max(old_size, 2 * mem::size_of::<T>()) * 2;
17351735
if old_size > size { fail!("capacity overflow") }
17361736
unsafe {
1737-
self.ptr = alloc_or_realloc(self.ptr, self.cap * mem::size_of::<T>(), size);
1737+
self.ptr = alloc_or_realloc(self.ptr, old_size, size);
17381738
}
17391739
self.cap = max(self.cap, 2) * 2;
17401740
}
@@ -1758,7 +1758,6 @@ impl<T> MutableSeq<T> for Vec<T> {
17581758
}
17591759
}
17601760
}
1761-
17621761
}
17631762

17641763
/// An iterator that moves out of a vector.

0 commit comments

Comments
 (0)