message: stdlib: move insertion sort from introsort() into a separate function
diff: @@ -34,7 +34,25 @@ fn introsort_helper(
  const THRESHOLD: size_t = 8;
  if nel < THRESHOLD {
  - // use an insertion sort instead of an introsort on small arrays
  + insertion_sort(base, nel, width, comp);
  + } else if nel > 1 {
  + if maxdepth == 0 {
  + heapsort(base, nel, width, comp);
  + } else {
  + let (left, right) = partition(base, nel, width, comp);
  + introsort_helper(base, left, width, maxdepth, comp);
  + let right_base = unsafe { base.add((right + 1) * width) };
  + introsort_helper(right_base, nel - (right + 1), width, maxdepth - 1, comp);
  + }
  + }
  +}
  +
  +fn insertion_sort(
  + base: *mut c_char,
  + nel: size_t,
  + width: size_t,
  + comp: extern "C" fn(*const c_void, *const c_void) -> c_int,
  +) {
  for i in 0..nel {
  for j in (0..i).rev() {
  let current = unsafe { base.add(j * width) };
  @@ -46,16 +64,6 @@ fn introsort_helper(
  }
  }
  }
  - } else if nel > 1 {
  - if maxdepth == 0 {
  - heapsort(base, nel, width, comp);
  - } else {
  - let (left, right) = partition(base, nel, width, comp);
  - introsort_helper(base, left, width, maxdepth, comp);
  - let right_base = unsafe { base.add((right + 1) * width) };
  - introsort_helper(right_base, nel - (right + 1), width, maxdepth - 1, comp);
  - }
  - }
  }
  fn heapsort(
  