From: Nicholas Clark Date: Tue, 6 Dec 2005 19:41:43 +0000 (+0000) Subject: The early return for SvIOKp(sv) in sv_2[iu]v_flags is actually code X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c8c0ed5d41f68ee21463aa813a9373b937b93c58;p=p5sagit%2Fp5-mst-13.2.git The early return for SvIOKp(sv) in sv_2[iu]v_flags is actually code duplication. p4raw-id: //depot/perl@26285 --- diff --git a/sv.c b/sv.c index 94ada28..ae3754f 100644 --- a/sv.c +++ b/sv.c @@ -1678,14 +1678,8 @@ Perl_sv_2iv_flags(pTHX_ register SV *sv, I32 flags) } } if (SvIOKp(sv)) { - if (SvIsUV(sv)) { - return (IV)(SvUVX(sv)); - } - else { - return SvIVX(sv); - } } - if (SvNOKp(sv)) { + else if (SvNOKp(sv)) { /* erm. not sure. *should* never get NOKp (without NOK) from sv_2nv * without also getting a cached IV/UV from it at the same time * (ie PV->NV conversion should detect loss of accuracy and cache @@ -1971,14 +1965,8 @@ Perl_sv_2uv_flags(pTHX_ register SV *sv, I32 flags) } } if (SvIOKp(sv)) { - if (SvIsUV(sv)) { - return SvUVX(sv); - } - else { - return (UV)SvIVX(sv); - } } - if (SvNOKp(sv)) { + else if (SvNOKp(sv)) { /* erm. not sure. *should* never get NOKp (without NOK) from sv_2nv * without also getting a cached IV/UV from it at the same time * (ie PV->NV conversion should detect loss of accuracy and cache