This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_sv_vcatpvfn_flags: reduce scope of 'gap' var
authorDavid Mitchell <davem@iabyn.com>
Tue, 9 May 2017 14:32:49 +0000 (15:32 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 7 Jun 2017 08:11:00 +0000 (09:11 +0100)
shouldn't make any functional difference

sv.c

diff --git a/sv.c b/sv.c
index 8c79581..11bd021 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -11628,7 +11628,6 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
 #endif
         NV nv;
        STRLEN float_need; /* what PL_efloatsize needs to become */
-       STRLEN gap;
        const char *dotstr = ".";
        STRLEN dotstrlen = 1;
        I32 efix = 0; /* explicit format parameter index */
@@ -13041,8 +13040,10 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
        }
 
 
+        /* append esignbuf, filler, zeroes, eptr and dotstr to sv */
+
         {
-            STRLEN need, have;
+            STRLEN need, have, gap;
 
             /* signed value that's wrapped? */
             assert(elen  <= ((~(STRLEN)0) >> 1));
@@ -13056,7 +13057,6 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
             if (need >= (((STRLEN)~0) - SvCUR(sv) - dotstrlen - 1))
                 croak_memory_wrap();
             SvGROW(sv, SvCUR(sv) + need + dotstrlen + 1);
-        }
 
             p = SvEND(sv);
             if (esignlen && fill == '0') {
@@ -13100,6 +13100,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
                 SvUTF8_on(sv);
             *p = '\0';
             SvCUR_set(sv, p - SvPVX_const(sv));
+        }
 
        if (vectorize) {
            esignlen = 0;