private void mergeSmall(T[] target,int pos,T[] s1,int from1,int to1,T[] s2,int from2,int to2){
  T x1=s1[from1], x2=s2[from2];
  while (true) {
    if (comp.compare(x1,x2) <= 0) {
      target[pos++]=x1;
      if (++from1 > to1) {
        System.arraycopy(s2,from2,target,pos,to2 - from2 + 1);
        break;
      }
      x1=s1[from1];
    }
 else {
      target[pos++]=x2;
      if (++from2 > to2) {
        System.arraycopy(s1,from1,target,pos,to1 - from1 + 1);
        break;
      }
      x2=s2[from2];
    }
  }
}

private void mergeSmall ( T [ ] target , int pos , T [ ] s1 , int from1 , int to1 , T [ ] s2 , int from2 , int to2 ) { T x1 = s1 [ from1 ] , x2 = s2 [ from2 ] ; while ( true ) { if ( comp . compare ( x1 , x2 ) <= 0 ) { target [ pos ++ ] = x1 ; if ( ++ from1 > to1 ) { System . arraycopy ( s2 , from2 , target , pos , to2 - from2 + 1 ) ; break ; } x1 = s1 [ from1 ] ; } else { target [ pos ++ ] = x2 ; if ( ++ from2 > to2 ) { System . arraycopy ( s1 , from1 , target , pos , to1 - from1 + 1 ) ; break ; } x2 = s2 [ from2 ] ; } } }
merge two ( small ) arrays using the temporary array . this is done to speed up merging .
