Branch: Tag:

2001-06-26

2001-06-26 12:42:02 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Special case for the empty array(s) in copy_array().

Rev: src/array.c:1.103

1: +    /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)
23:   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.102 2001/06/06 02:22:35 mast Exp $"); + RCSID("$Id: array.c,v 1.103 2001/06/26 12:42:02 grubba Exp $");      PMOD_EXPORT struct array empty_array=   {
572:   {    struct array *a;    +  if (!v->size) { +  /* Empty array. */ +  add_ref(&empty_array); +  return &empty_array; +  } +     a=allocate_array_no_init(v->size, 0);    a->type_field = v->type_field;