summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-07-29 00:26:55 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-07-29 00:28:01 -0700
commitd96ab1b5f316fcb0109627c2060d3b7f8a7b5016 (patch)
treedd5c68bc32106b4dc2d45e7f733a385f2bb7fe32
parent019070c31184a4deb57cb85f7e597a789c6c5b54 (diff)
downloadperl-d96ab1b5f316fcb0109627c2060d3b7f8a7b5016.tar.gz
Remove some redundant magical flag checks
Now that gmagical svs use the OK flags the same way as muggles, things like SvPOK || (SvGMAGICAL && SvPOKp) are no longer necessary.
-rw-r--r--pp.c2
-rw-r--r--universal.c8
2 files changed, 4 insertions, 6 deletions
diff --git a/pp.c b/pp.c
index a57f609d5b..5a40a2d29c 100644
--- a/pp.c
+++ b/pp.c
@@ -2182,7 +2182,7 @@ PP(pp_negate)
{
SV * const sv = TOPs;
- if (SvIOK(sv) || (SvGMAGICAL(sv) && SvIOKp(sv))) {
+ if (SvIOK(sv)) {
/* It's publicly an integer */
oops_its_an_int:
if (SvIsUV(sv)) {
diff --git a/universal.c b/universal.c
index a7c480f52c..cb49e0b2f0 100644
--- a/universal.c
+++ b/universal.c
@@ -198,8 +198,7 @@ Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags)
SvGETMAGIC(sv);
- if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv))
- || (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv)))) {
+ if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv)))) {
LEAVE;
return FALSE;
}
@@ -334,8 +333,7 @@ XS(XS_UNIVERSAL_isa)
SvGETMAGIC(sv);
- if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv))
- || (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv))))
+ if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv))))
XSRETURN_UNDEF;
ST(0) = boolSV(sv_derived_from_sv(sv, ST(1), 0));
@@ -359,7 +357,7 @@ XS(XS_UNIVERSAL_can)
SvGETMAGIC(sv);
if (!SvOK(sv) || !(SvROK(sv) || SvNIOK(sv) || (SvPOK(sv) && SvCUR(sv))
- || (SvGMAGICAL(sv) && (SvNIOKp(sv) || (SvPOKp(sv) && SvCUR(sv))))))
+ ))
XSRETURN_UNDEF;
rv = &PL_sv_undef;