Branch: Tag:

2012-11-04

2012-11-04 17:59:56 by Arne Goedeke <el@laramies.com>

mapping: remove overoptimization when looking up objects

117:    FREE_KEYPAIR(md, k);   }    + static INLINE int check_type_contains(TYPE_FIELD types, const struct svalue * s) { +  return (TYPEOF(*s) == PIKE_T_OBJECT || types & (BIT_OBJECT|(1 << TYPEOF(*s)))); + } +    #ifdef PIKE_DEBUG      /** This function checks that the type field isn't lacking any bits.
549:    { \    h=h2 & (md->hashsize - 1); \    DO_IF_DEBUG( if(d_flag > 1) check_mapping_type_fields(m); ) \ -  if(md->ind_types & ((1 << TYPEOF(*key)) | BIT_OBJECT)) \ +  if(check_type_contains(md->ind_types, key)) \    { \    for(prev= md->hash + h;(k=*prev);prev=&k->next) \    { \
572:    { \    h=h2 & (md->hashsize-1); \    DO_IF_DEBUG( if(d_flag > 1) check_mapping_type_fields(m); ) \ -  if(md->ind_types & ((1 << TYPEOF(*key)) | BIT_OBJECT)) \ +  if(check_type_contains(md->ind_types, key)) \    { \    k2=omd->hash[h2 & (omd->hashsize - 1)]; \    prev= md->hash + h; \