Skip to main content.
home | support | download

Back to List Archive

Re: New versions of swish-e 2.x

From: <jmruiz(at)not-real.boe.es>
Date: Wed Nov 15 2000 - 10:07:40 GMT
Thanks, Bill

I will look at it. Good work!!

cu
Jose

On 14 Nov 2000, at 20:28, Bill Moseley wrote:

> One more quick patch in SwishSeek().  Seems like SwishSeek wasn't
> setting the position in sw->currentresult.  I hope that's the correct
> fix.
> 
> By the way, I'm not clear what 
>     sw->currentresult=0;
> is/was used for.  I removed it while testing (and from this patch) but
> maybe it should be back in.  
> 
> Jose, do you think there would be any performance gains from building
> a linked list of the addresses of, say, every hundred or so results so
> that SwishSeek could quickly index near the desired seek position
> before walking the pointers?
> 
> swish-e-2.1.8/src > diff -u ../orig/swish2.c .
> --- ../orig/swish2.c    Tue Nov 14 19:20:26 2000
> +++ ./swish2.c  Tue Nov 14 19:35:14 2000
> @@ -310,13 +310,18 @@
>      int i;
>      struct result *sp;
>      if(!sw) return INVALID_SWISH_HANDLE;
> -    sw->currentresult=0;
>      for (i=0,sp=SwishNext(sw);sp && i<pos;i++)
>      {
>          sp = sp->nextsort;
>      }
> +
>      if(!sp) return(sw->lasterror);
> -    else return pos;
> +    else
> +    {
> +        /* set the current pointer */
> +        sw->currentresult = sp;
> +        return pos;
> +    }
>  }
> 
> 
> Or the entire routine:
> 
> int SwishSeek(struct SWISH *sw,int pos)
> {
>     int i;
>     struct result *sp;
>     if(!sw) return INVALID_SWISH_HANDLE;
>     for (i=0,sp=SwishNext(sw);sp && i<pos;i++)
>     {
>         sp = sp->nextsort;
>     }
> 
>     if(!sp) return(sw->lasterror);
>     else
>     {
>         /* set the current pointer */
>         sw->currentresult = sp;
>         return pos;
>     }
> }
> 
> 
> Bill Moseley
> mailto:moseley@hank.org
> 
Received on Wed Nov 15 10:09:11 2000