summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2006-07-03 12:41:48 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-07-04 12:04:58 +0000
commit3469222433b317d18cea77514faabef96011806b (patch)
tree5a081057ad9a1c782d0a761684a2f3ad7e167273 /universal.c
parentbbd11bfc71646921e3be8023a3989fb2a9921d80 (diff)
downloadperl-3469222433b317d18cea77514faabef96011806b.tar.gz
consting and localizing in universal.c
Message-ID: <20060703224148.GA14449@petdance.com> p4raw-id: //depot/perl@28477
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/universal.c b/universal.c
index 7cbaaf7e48..e674d50674 100644
--- a/universal.c
+++ b/universal.c
@@ -32,7 +32,7 @@
*/
STATIC bool
-S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
+S_isa_lookup(pTHX_ HV *stash, const char *name, const HV* const name_stash,
int len, int level)
{
dVAR;
@@ -45,7 +45,7 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
/* A stash/class can go by many names (ie. User == main::User), so
we compare the stash itself just in case */
- if (name_stash && (stash == name_stash))
+ if (name_stash && ((const HV *)stash == name_stash))
return TRUE;
hvname = HvNAME_get(stash);
@@ -66,11 +66,12 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
&& (hv = GvHV(gv)))
{
if (SvIV(subgen) == (IV)PL_sub_generation) {
- SV* sv;
SV** const svp = (SV**)hv_fetch(hv, name, len, FALSE);
- if (svp && (sv = *svp) != (SV*)&PL_sv_undef) {
- DEBUG_o( Perl_deb(aTHX_ "Using cached ISA %s for package %s\n",
- name, hvname) );
+ if (svp) {
+ SV * const sv = *svp;
+ if (sv != &PL_sv_undef)
+ DEBUG_o( Perl_deb(aTHX_ "Using cached ISA %s for package %s\n",
+ name, hvname) );
return (sv == &PL_sv_yes);
}
}