Branch: Tag:

2001-06-15

2001-06-15 02:12:32 by Per Hedbor <ph@opera.com>

Use wf_resultset_push instead of push_object. The former clears the set if it's empty (freeing the resultset pointer, thus making the |, &, add_ranking and - significantly faster for the case when one of the operands is the empty resultset.

Rev: src/modules/_WhiteFish/resultset.h:1.8
Rev: src/modules/_WhiteFish/whitefish.c:1.30

3:   #include "global.h"   #include "stralloc.h"   #include "global.h" - RCSID("$Id: whitefish.c,v 1.29 2001/05/31 17:15:26 norlin Exp $"); + RCSID("$Id: whitefish.c,v 1.30 2001/06/15 02:12:28 per Exp $");   #include "pike_macros.h"   #include "interpret.h"   #include "program.h"
424:    {    struct object *o = wf_resultset_new( );    pop_n_elems( args ); -  push_object( o ); +  wf_resultset_push( o );    return;    }   
438:       res = low_do_query_phrase(blobs,numblobs, field_coefficients );    pop_n_elems( args ); -  push_object( res ); +  wf_resultset_push( res );   }      static void f_do_query_and( INT32 args )
511:    {    struct object *o = wf_resultset_new( );    pop_n_elems( args ); -  push_object( o ); +  wf_resultset_push( o );    return;    }   
531:    proximity_coefficients,    cutoff );    pop_n_elems( args ); -  push_object( res ); +  wf_resultset_push( res );   }      static void f_do_query_or( INT32 args )
604:    {    struct object *o = wf_resultset_new( );    pop_n_elems( args ); -  push_object( o ); +  wf_resultset_push( o );    return;    }   
624:    proximity_coefficients,    cutoff );    pop_n_elems( args ); -  push_object( res ); +  wf_resultset_push( res );   }