Branch: Tag:

2003-04-27

2003-04-27 16:17:33 by Martin Stjernholm <mast@lysator.liu.se>

Separated the low level stuff in f_column into a new array_column and fixed
type field handling. Fixed type field handling in aggregate_array.

Rev: src/array.c:1.141
Rev: src/array.h:1.48
Rev: src/builtin.cmod:1.133

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin.cmod,v 1.132 2003/04/10 17:08:16 nilsson Exp $ + || $Id: builtin.cmod,v 1.133 2003/04/27 16:17:33 mast Exp $   */      #include "global.h"
273:    efun;    optflags OPT_TRY_OPTIMIZE;   { -  INT32 e; -  struct array *a; -  -  DECLARE_CYCLIC(); -  -  /* Optimization */ -  if(data->refs == 1) -  { -  /* An array with one ref cannot possibly be cyclic */ -  struct svalue sval; -  data->type_field = BIT_MIXED | BIT_UNFINISHED; -  for(e=0;e<data->size;e++) -  { -  index_no_free(&sval, ITEM(data)+e, index); -  free_svalue(ITEM(data)+e); -  ITEM(data)[e]=sval; +  RETURN array_column (data, index);   } -  pop_stack(); -  return; -  } +     -  if((a=(struct array *)BEGIN_CYCLIC(data,0))) -  { -  add_ref(a); -  }else{ -  push_array(a=allocate_array(data->size)); -  SET_CYCLIC_RET(a); -  -  for(e=0;e<a->size;e++) -  index_no_free(ITEM(a)+e, ITEM(data)+e, index); -  -  dmalloc_touch_svalue(Pike_sp-1); -  Pike_sp--; -  } -  END_CYCLIC(); -  RETURN a; - } -  +    /*! @decl multiset mkmultiset(array a)    *!    *! This function creates a multiset from an array.