- size_t n1 = n / 2;
- size_t n2 = (n + 1) / 2;
- /* Note: n1 + n2 = n, n1 <= n2. */
- /* Sort src[n1..n-1] into dst[n1..n-1], scratching tmp[0..n2/2-1]. */
- merge_sort_fromto (src + n1, dst + n1, n2, tmp);
- /* Sort src[0..n1-1] into tmp[0..n1-1], scratching dst[0..n1-1]. */
- merge_sort_fromto (src, tmp, n1, dst);
- /* Merge the two half results. */
- merge (tmp, n1, dst + n1, n2, dst);
+ size_t n1 = n / 2;
+ size_t n2 = (n + 1) / 2;
+ /* Note: n1 + n2 = n, n1 <= n2. */
+ /* Sort src[n1..n-1] into dst[n1..n-1], scratching tmp[0..n2/2-1]. */
+ merge_sort_fromto (src + n1, dst + n1, n2, tmp);
+ /* Sort src[0..n1-1] into tmp[0..n1-1], scratching dst[0..n1-1]. */
+ merge_sort_fromto (src, tmp, n1, dst);
+ /* Merge the two half results. */
+ merge (tmp, n1, dst + n1, n2, dst);