bridge/class-master/depend/pari/src/basemath/bibli2.c
/* in case of equal keys in x,y, take the key from x */
in case of equal keys in x,y, take the key from x
in case of equal keys in x y take the key from x
static GEN
ZV_union_shallow_t(GEN x, GEN y, long t)
{
  long i, j, k, lx = lg(x), ly = lg(y);
  GEN z = cgetg(lx + ly - 1, t);
  i = j = k = 1;
  while (i<lx && j<ly)
  {
    int s = cmpii(gel(x,i), gel(y,j));
    if (s < 0)
      z[k++] = x[i++];
    else if (s > 0)
      z[k++] = y[j++];
    else {
      z[k++] = x[i++];
      j++;
    }
  }
  while (i<lx) z[k++] = x[i++];
  while (j<ly) z[k++] = y[j++];
  setlg(z, k); return z;
}
static GEN ZV_union_shallow_t ( GEN x , GEN y , long t ) { long i , j , k , lx = lg ( x ) , ly = lg ( y ) ; GEN z = cgetg ( lx + ly - 1 , t ) ; i = j = k = 1 ; while ( i < lx && j < ly ) { int s = cmpii ( gel ( x , i ) , gel ( y , j ) ) ; if ( s < 0 ) z [ k ++ ] = x [ i ++ ] ; else if ( s > 0 ) z [ k ++ ] = y [ j ++ ] ; else { z [ k ++ ] = x [ i ++ ] ; j ++ ; } } while ( i < lx ) z [ k ++ ] = x [ i ++ ] ; while ( j < ly ) z [ k ++ ] = y [ j ++ ] ; setlg ( z , k ) ; return z ; }
in case of equal keys in x,y, take the key from x
in case of equal keys in x y take the key from x