continue;
if (HeKLEN(entry) != klen)
continue;
- if (memcmp(HeKEY(entry),key,klen)) /* is this it? */
+ if (memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
return &HeVAL(entry);
}
return 0;
if (SvRMAGICAL(hv) && mg_find((SV*)hv,'P')) {
- char *k;
- HEK *hek;
+ static HE mh;
- New(54, k, HEK_BASESIZE + sizeof(SV*), char);
- hek = (HEK*)k;
sv = sv_newmortal();
keysv = sv_2mortal(newSVsv(keysv));
mg_copy((SV*)hv, sv, (char*)keysv, HEf_SVKEY);
- entry = &He;
- HeVAL(entry) = sv;
- HeKEY_hek(entry) = hek;
- HeSVKEY_set(entry, keysv);
- HeKLEN(entry) = HEf_SVKEY; /* hent_key is holding an SV* */
- return entry;
+ if (!HeKEY_hek(&mh)) {
+ char *k;
+ New(54, k, HEK_BASESIZE + sizeof(SV*), char);
+ HeKEY_hek(&mh) = (HEK*)k;
+ HeKLEN(&mh) = HEf_SVKEY; /* key will always hold an SV* */
+ }
+ HeSVKEY_set(&mh, keysv);
+ HeVAL(&mh) = sv;
+ return &mh;
}
xhv = (XPVHV*)SvANY(hv);
continue;
if (HeKLEN(entry) != klen)
continue;
- if (memcmp(HeKEY(entry),key,klen)) /* is this it? */
+ if (memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
return entry;
}
xhv = (XPVHV*)SvANY(hv);
if (SvMAGICAL(hv)) {
mg_copy((SV*)hv, val, key, klen);
-#ifndef OVERLOAD
- if (!xhv->xhv_array)
- return 0;
-#else
- if (!xhv->xhv_array && (SvMAGIC(hv)->mg_type != 'A'
- || SvMAGIC(hv)->mg_moremagic))
- return 0;
+ if (!xhv->xhv_array
+ && (SvMAGIC(hv)->mg_moremagic
+ || (SvMAGIC(hv)->mg_type != 'E'
+#ifdef OVERLOAD
+ && SvMAGIC(hv)->mg_type != 'A'
#endif /* OVERLOAD */
+ )))
+ return 0;
}
if (!hash)
PERL_HASH(hash, key, klen);
continue;
if (HeKLEN(entry) != klen)
continue;
- if (memcmp(HeKEY(entry),key,klen)) /* is this it? */
+ if (memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
SvREFCNT_dec(HeVAL(entry));
HeVAL(entry) = val;
if (SvMAGICAL(hv)) {
keysv = sv_2mortal(newSVsv(keysv));
mg_copy((SV*)hv, val, (char*)keysv, HEf_SVKEY);
-#ifndef OVERLOAD
- if (!xhv->xhv_array)
- return Nullhe;
-#else
- if (!xhv->xhv_array && (SvMAGIC(hv)->mg_type != 'A'
- || SvMAGIC(hv)->mg_moremagic))
- return Nullhe;
+ if (!xhv->xhv_array
+ && (SvMAGIC(hv)->mg_moremagic
+ || (SvMAGIC(hv)->mg_type != 'E'
+#ifdef OVERLOAD
+ && SvMAGIC(hv)->mg_type != 'A'
#endif /* OVERLOAD */
+ )))
+ return Nullhe;
}
key = SvPV(keysv, klen);
continue;
if (HeKLEN(entry) != klen)
continue;
- if (memcmp(HeKEY(entry),key,klen)) /* is this it? */
+ if (memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
SvREFCNT_dec(HeVAL(entry));
HeVAL(entry) = val;
continue;
if (HeKLEN(entry) != klen)
continue;
- if (memcmp(HeKEY(entry),key,klen)) /* is this it? */
+ if (memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
*oentry = HeNEXT(entry);
if (i && !*oentry)
continue;
if (HeKLEN(entry) != klen)
continue;
- if (memcmp(HeKEY(entry),key,klen)) /* is this it? */
+ if (memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
*oentry = HeNEXT(entry);
if (i && !*oentry)
continue;
if (HeKLEN(entry) != klen)
continue;
- if (memcmp(HeKEY(entry),key,klen)) /* is this it? */
+ if (memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
return TRUE;
}
continue;
if (HeKLEN(entry) != klen)
continue;
- if (memcmp(HeKEY(entry),key,klen)) /* is this it? */
+ if (memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
return TRUE;
}
{
if (!hent)
return;
+ if (SvTYPE(HeVAL(hent)) == SVt_PVGV && GvCV(HeVAL(hent)))
+ sub_generation++; /* May be deletion of method? */
SvREFCNT_dec(HeVAL(hent));
if (HeKLEN(hent) == HEf_SVKEY) {
SvREFCNT_dec(HeKEY_sv(hent));
continue;
if (HeKLEN(entry) != len)
continue;
- if (memcmp(HeKEY(entry),str,len)) /* is this it? */
+ if (memNE(HeKEY(entry),str,len)) /* is this it? */
continue;
found = 1;
if (--HeVAL(entry) == Nullsv) {
continue;
if (HeKLEN(entry) != len)
continue;
- if (memcmp(HeKEY(entry),str,len)) /* is this it? */
+ if (memNE(HeKEY(entry),str,len)) /* is this it? */
continue;
found = 1;
break;