Branch: Tag:

2001-08-31

2001-08-31 06:53:36 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

inlined a function, save a cycle

Rev: src/array.c:1.116
Rev: src/array.h:1.37

23:   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.115 2001/07/01 21:34:50 mast Exp $"); + RCSID("$Id: array.c,v 1.116 2001/08/31 06:53:36 hubbe Exp $");      PMOD_EXPORT struct array empty_array=   {
165:    return a;   }    - /* -  * Extract an svalue from an array -  */ - PMOD_EXPORT void array_index_no_free(struct svalue *s,struct array *v,INT32 index) - { - #ifdef PIKE_DEBUG -  if(index<0 || index>=v->size) -  fatal("Illegal index in low level index routine.\n"); - #endif +     -  assign_svalue_no_free(s, ITEM(v) + index); - } -  +    /*    * Extract an svalue from an array    */
250:    free_svalue(ITEM(v) + index);   }    - /* -  * Set an index in an array -  */ - PMOD_EXPORT void array_set_index(struct array *v,INT32 index, struct svalue *s) - { - #ifdef PIKE_DEBUG -  if(index<0 || index>v->size) -  fatal("Illegal index in low level array set routine.\n"); - #endif +     -  add_ref(v); -  check_destructed(s); -  -  v->type_field = (v->type_field & ~BIT_UNFINISHED) | (1 << s->type); -  assign_svalue( ITEM(v) + index, s); -  free_array(v); - } -  -  +    PMOD_EXPORT void simple_set_index(struct array *a,struct svalue *ind,struct svalue *s)   {    INT32 i;