This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Remove unnecessary intermediate values
authorKarl Williamson <public@khwilliamson.com>
Wed, 16 Nov 2011 16:45:07 +0000 (09:45 -0700)
committerKarl Williamson <public@khwilliamson.com>
Fri, 13 Jan 2012 16:58:32 +0000 (09:58 -0700)
regexec.c

index 44d7b96..b80bee8 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -6500,23 +6500,22 @@ Perl_regclass_swash(pTHX_ const regexp *prog, register const regnode* node, bool
            SV * const rv = MUTABLE_SV(data->data[n]);
            AV * const av = MUTABLE_AV(SvRV(rv));
            SV **const ary = AvARRAY(av);
-           SV **a, **b;
        
            /* See the end of regcomp.c:S_regclass() for
             * documentation of these array elements. */
 
            si = *ary;
-           a  = SvROK(ary[1]) ? &ary[1] : NULL;
-           b  = SvTYPE(ary[2]) == SVt_PVAV ? &ary[2] : NULL;
 
-           if (a)
-               sw = *a;
+           if (SvROK(ary[1])) {
+               sw = ary[1];
+           }
            else if (si && doinit) {
                sw = swash_init("utf8", "", si, 1, 0);
                (void)av_store(av, 1, sw);
            }
-           if (b)
-               alt = *b;
+           if (SvTYPE(ary[2]) == SVt_PVAV) {
+               alt = ary[2];
+           }
        }
     }