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.80 2000/04/27 02:13:28 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.81 2000/04/30 23:15:16 hubbe Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "language.h"   #include "error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"
pike.git/src/mapping.c:1356:    }      #if 1    /* Major optimization */    for(d=0;d<args;d++)    if(e==argp[d].u.mapping->data->size)    return copy_mapping(argp[d].u.mapping);   #endif       /* FIXME: need locking! */ +  if(argp[0].u.mapping->refs == 1) +  { +  ret=argp[0].u.mapping; +  d=1; +  }else{    ret=allocate_mapping(MAP_SLOTS(e)); -  for(d=0;d<args;d++) +  d=0; +  } +  for(;d<args;d++)    MAPPING_LOOP(argp[d].u.mapping)    mapping_insert(ret, &k->ind, &k->val);    return ret;   }      int mapping_equal_p(struct mapping *a, struct mapping *b, struct processing *p)   {    struct processing curr;    struct keypair *k;    struct mapping_data *md;