mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 10:55:14 +00:00
Remove useless bound checks from into_sorted_vec
This commit is contained in:
parent
25b3f61c38
commit
8d1575365d
@ -495,7 +495,10 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
let mut end = self.len();
|
||||
while end > 1 {
|
||||
end -= 1;
|
||||
self.data.swap(0, end);
|
||||
unsafe {
|
||||
let ptr = self.data.as_mut_ptr();
|
||||
ptr::swap(ptr, ptr.add(end));
|
||||
}
|
||||
self.sift_down_range(0, end);
|
||||
}
|
||||
self.into_vec()
|
||||
|
Loading…
Reference in New Issue
Block a user