leave_scope(): combine the SAVEt_*PTR branches
authorDavid Mitchell <davem@iabyn.com>
Fri, 12 Aug 2016 11:59:14 +0000 (12:59 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 12 Aug 2016 13:02:22 +0000 (14:02 +0100)
They're all the same, except for casts between different pointer types.

scope.c

diff --git a/scope.c b/scope.c
index 81f3bb6..d78857b 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -1052,24 +1052,12 @@ Perl_leave_scope(pTHX_ I32 base)
            break;
 
        case SAVEt_SPTR:                        /* SV* reference */
-            a0 = ap[0]; a1 = ap[1];
-           *a1.any_svp= a0.any_sv;
-           break;
-
        case SAVEt_VPTR:                        /* random* reference */
        case SAVEt_PPTR:                        /* char* reference */
-            a0 = ap[0]; a1 = ap[1];
-           *a1.any_pvp = a0.any_pv;
-           break;
-
        case SAVEt_HPTR:                        /* HV* reference */
-            a0 = ap[0]; a1 = ap[1];
-           *(HV**)a1.any_ptr = a0.any_hv;
-           break;
-
        case SAVEt_APTR:                        /* AV* reference */
             a0 = ap[0]; a1 = ap[1];
-           *(AV**)a1.any_ptr = a0.any_av;
+           *a1.any_svp= a0.any_sv;
            break;
 
        case SAVEt_GP:                          /* scalar reference */