diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-10-22 19:59:36 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-10-22 19:59:36 +0200 |
commit | 010434d45e3a798ee8ecbc1df77c8e1cafc561ab (patch) | |
tree | 4e9d49a6b3a00a2100650ebbfb611ac5ea1b0b1f /cpan/ExtUtils-Constant | |
parent | c553cca00d719f5fcdff702b67da6044ef5a0601 (diff) | |
download | perl-010434d45e3a798ee8ecbc1df77c8e1cafc561ab.tar.gz |
For PROXYSUBS, get the hash from the fetch to pass to the subsequent store.
This saves the store having to (re)compute the hash.
Diffstat (limited to 'cpan/ExtUtils-Constant')
-rw-r--r-- | cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm index 0038831a9a..d9eca8bfa1 100644 --- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm +++ b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm @@ -448,17 +448,24 @@ EOBOOT EXPLODE /* Need to add prototypes, else parsing will vary by platform. */ - SV **sv = hv_fetch(symbol_table, value_for_notfound->name, - value_for_notfound->namelen, TRUE); - if (!sv) { + HE *he = (HE*) hv_common_key_len(symbol_table, + value_for_notfound->name, + value_for_notfound->namelen, + HV_FETCH_LVALUE, NULL, 0); + SV *sv; +#ifndef SYMBIAN + HEK *hek; +#endif + if (!he) { Perl_croak($athx "Couldn't add key '%s' to %%$package_sprintf_safe\::", value_for_notfound->name); } - if (!SvOK(*sv) && SvTYPE(*sv) != SVt_PVGV) { + sv = HeVAL(he); + if (!SvOK(sv) && SvTYPE(sv) != SVt_PVGV) { /* Nothing was here before, so mark a prototype of "" */ - sv_setpvn(*sv, "", 0); - } else if (SvPOK(*sv) && SvCUR(*sv) == 0) { + sv_setpvn(sv, "", 0); + } else if (SvPOK(sv) && SvCUR(sv) == 0) { /* There is already a prototype of "" - do nothing */ } else { /* Someone has been here before us - have to make a real @@ -476,8 +483,10 @@ EXPLODE CvXSUBANY(cv).any_ptr = NULL; } #ifndef SYMBIAN - if (!hv_store(${c_subname}_missing, value_for_notfound->name, - value_for_notfound->namelen, &PL_sv_yes, 0)) + hek = HeKEY_hek(he); + if (!hv_common(${c_subname}_missing, NULL, HEK_KEY(hek), + HEK_LEN(hek), HEK_FLAGS(hek), HV_FETCH_ISSTORE, + &PL_sv_yes, HEK_HASH(hek))) Perl_croak($athx "Couldn't add key '%s' to missing_hash", value_for_notfound->name); #endif |