This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The early return for SvIOKp(sv) in sv_2[iu]v_flags is actually code
authorNicholas Clark <nick@ccl4.org>
Tue, 6 Dec 2005 19:41:43 +0000 (19:41 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 6 Dec 2005 19:41:43 +0000 (19:41 +0000)
duplication.

p4raw-id: //depot/perl@26285

sv.c

diff --git a/sv.c b/sv.c
index 94ada28..ae3754f 100644 (file)
--- 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