This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mg.c: Reorder if else clauses
authorKarl Williamson <public@khwilliamson.com>
Tue, 10 Sep 2013 01:39:07 +0000 (19:39 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 27 Nov 2013 04:03:39 +0000 (21:03 -0700)
This is to allow two cases in the switch statement to be combined in the
next commit.  There should be no effective logic change

mg.c

diff --git a/mg.c b/mg.c
index 613a14e..1f494dc 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -788,7 +788,11 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
        sv_setiv(sv, (IV)(PL_debug & DEBUG_MASK));
        break;
     case '\005':  /* ^E */
-        if (nextchar == '\0') {
+        if (nextchar != '\0') {
+            if (strEQ(remaining, "NCODING"))
+                sv_setsv(sv, PL_encoding);
+        }
+        else {
 #if defined(VMS)
             {
                  char msg[255];
@@ -834,8 +838,6 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
             SvRTRIM(sv);
             SvNOK_on(sv);      /* what a wonderful hack! */
         }
-        else if (strEQ(remaining, "NCODING"))
-             sv_setsv(sv, PL_encoding);
         break;
 
     case '!':