- if (no == 1)
- return rsisamb_create(NULL, /* FIXME - use some nmem */
- sizeof(struct it_key), key_compare_it,
- zi->reg->isamb, *isam_p);
- /*
- {
- rset_isamb_parms parms;
- parms.key_size = sizeof(struct it_key);
- parms.cmp = key_compare_it;
- parms.pos = *isam_p;
- parms.is = zi->reg->isamb;
- return rset_create (rset_kind_isamb, &parms);
- }
- */
-#if 1
- else if (no <10000 ) /* FIXME - hardcoded number */
- {
- RSET r;
- RSET *rsets=xmalloc(no*sizeof(RSET)); /* use nmem! */
- int i;
- for (i=0;i<no;i++)
- rsets[i]=rsisamb_create(NULL, /* */
- sizeof(struct it_key), key_compare_it,
- zi->reg->isamb, isam_p[i] );
- r=rsmultior_create( NULL, /* FIXME - use some nmem */
- sizeof(struct it_key), key_compare_it,
- no, rsets);
- xfree(rsets);
- return r;
- /*
- rset_multior_parms m_parms;
- rset_isamb_parms b_parms;
- int i;
- m_parms.key_size = sizeof(struct it_key);
- m_parms.cmp = key_compare_it;
- m_parms.no_rsets=no;
- m_parms.rsets=xmalloc(sizeof(*m_parms.rsets)*no);
- b_parms.key_size = sizeof(struct it_key);
- b_parms.cmp = key_compare_it;
- b_parms.is = zi->reg->isamb;
- for (i=0;i<no;i++)
- {
- b_parms.pos = isam_p[i];
- m_parms.rsets[i]=rset_create (rset_kind_isamb, &b_parms);
- }
- return rset_create (rset_kind_multior, &m_parms);
- */
- } /* <10000 - rs_multior */
-#endif
- qsort (isam_p, no, sizeof(*isam_p), isamc_trunc_cmp);
+ RSET r;
+ RSET *rsets = xmalloc(no*sizeof(RSET)); /* use nmem! */
+ int i;
+ for (i = 0; i<no; i++)
+ rsets[i] = rsisamb_create(rset_nmem, kctrl, scope,
+ zh->reg->isamb, isam_p[i],
+ 0 /* termid */);
+ r = rset_create_or(rset_nmem, kctrl, scope,
+ termid, no, rsets);
+ xfree(rsets);
+ return r;