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.81 2000/04/30 23:15:16 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.82 2000/05/01 02:10:30 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) +  if(argp[0].u.mapping->refs == 1 && +  !argp[0].u.mapping->data->hardlinks)    { -  ret=argp[0].u.mapping; +  add_ref( ret=argp[0].u.mapping );    d=1;    }else{    ret=allocate_mapping(MAP_SLOTS(e));    d=0;    }    for(;d<args;d++)    MAPPING_LOOP(argp[d].u.mapping)    mapping_insert(ret, &k->ind, &k->val);    return ret;   }