| 3091 | /// - `len`: @param len - |
| 3092 | /// the number of array elements to be copied. |
| 3093 | private static void copySwap(Object[] src, int from, Object[] dst, int to, |
| 3094 | int len) { |
| 3095 | if (src == dst && from + len > to) { |
| 3096 | int new_to = to + len - 1; |
| 3097 | for (; from < to; from++, new_to--, len--) { |
| 3098 | dst[new_to] = src[from]; |
| 3099 | } |
| 3100 | for (; len > 1; from++, new_to--, len -= 2) { |
| 3101 | swap(from, new_to, dst); |
| 3102 | } |
| 3103 | |
| 3104 | } else { |
| 3105 | to = to + len - 1; |
| 3106 | for (; len > 0; from++, to--, len--) { |
| 3107 | dst[to] = src[from]; |
| 3108 | } |
| 3109 | } |
| 3110 | } |
| 3111 | |
| 3112 | /// Performs a sort on the given String array. Elements will be re-ordered into |
| 3113 | /// ascending order. |