pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.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" - RCSID("$Id: mapping.c,v 1.133 2001/09/01 09:38:56 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.134 2001/09/05 01:40:45 hubbe Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"   #include "interpret.h"
pike.git/src/mapping.c:1583:    {    struct svalue *s;    if((s=low_mapping_lookup(b, & k->ind)))    {    if(!low_is_equal(s, &k->val, &curr))    {    eq=0;    break;    }    }else{ +  INT32 d; +  struct mapping_data *bmd = b->data; +  struct keypair *kp; +  +  /* This is neither pretty nor fast, but it should +  * perform a bit more like expected... -Hubbe +  */ +  +  bmd->valrefs++; +  add_ref(bmd); +     eq=0; -  +  for(d=0;d<(bmd)->hashsize;d++) +  { +  for(kp=bmd->hash[d];kp;kp=kp->next) +  { +  if(low_is_equal(&k->ind, &kp->ind, &curr) && +  low_is_equal(&k->val, &kp->val, &curr)) +  { +  eq=1;    break;    }    } -  +  } +  +  bmd->valrefs--; +  free_mapping_data(bmd); +  +  if(!eq) break; +  } +  }    md->valrefs--;    free_mapping_data(md);    return eq;   }      void describe_mapping(struct mapping *m,struct processing *p,int indent)   {    struct processing doing;    struct array *a;    JMP_BUF catch;