pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h"   #include <math.h> - RCSID("$Id: operators.c,v 1.59 1999/08/17 01:05:56 mast Exp $"); + RCSID("$Id: operators.c,v 1.60 1999/10/01 20:45:06 hubbe Exp $");   #include "interpret.h"   #include "svalue.h"   #include "multiset.h"   #include "mapping.h"   #include "array.h"   #include "stralloc.h"   #include "opcodes.h"   #include "operators.h"   #include "language.h"   #include "pike_memory.h"
pike.git/src/operators.c:831:    r_speedup(args>>1,func);    UNSET_ONERROR(err);    sp++[0]=tmp;    func();    }   }   static void speedup(INT32 args, void (*func)(void))   {    switch(sp[-args].type)    { -  case T_ARRAY: +  /* This method can be used for types where a op b === b op a */    case T_MULTISET:    {    int e=-1;    while(args > 1)    {    struct svalue tmp;    func();    args--;    e++;    if(e - args >= -1)
pike.git/src/operators.c:853:    e=0;    }else{    tmp=sp[e-args];    sp[e-args]=sp[-1];    sp[-1]=tmp;    }    }    return;    }    +  /* Binary balanced tree method for types where +  * a op b may or may not be equal to b op a +  */ +  case T_ARRAY:    case T_MAPPING:    r_speedup(args,func);    return;       default:    while(--args > 0) func();    }   }      void f_and(INT32 args)