Sorting algorithms/Merge sort: Difference between revisions

Content added Content deleted
m (BBC BASIC moved to the BASIC section.)
Line 6,285: Line 6,285:
#[inline(always)]
#[inline(always)]
fn copy<T: Copy>(src: &[T], dst: &mut [T]) {
fn copy<T: Copy>(src: &[T], dst: &mut [T]) {
// for i in 0..src.len() {
for i in 0..src.len() {
// dst[i] = src[i];
dst[i] = src[i];
// }
unsafe {
std::ptr::copy_nonoverlapping(src.as_ptr(), dst.as_mut_ptr(), src.len());
}
}
}
}