pike.git/
src/
mapping.c
Branch:
Tag:
Non-build tags
All tags
No tags
2014-12-04
2014-12-04 19:22:57 by Arne Goedeke <el@laramies.com>
df160c2f1ee951e54bd1fa44718df62d9e8bc090 (
9
lines) (+
7
/-
2
)
[
Show
|
Annotate
]
Branch:
bill/master_archive_support
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; \