This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Rmv temporary variable
authorKarl Williamson <khw@cpan.org>
Wed, 7 May 2014 22:41:51 +0000 (16:41 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 31 May 2014 16:02:22 +0000 (10:02 -0600)
This variable is unused after its first use, so can just be elminated.

regcomp.c

index ab0085f..7f51fea 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13564,7 +13564,6 @@ parseit:
                }
                if (!SIZE_ONLY) {
                     SV* invlist;
-                    char* formatted;
                     char* name;
 
                    if (UCHARAT(RExC_parse) == '^') {
@@ -13585,14 +13584,13 @@ parseit:
                      * will have its name be <__NAME_i>.  The design is
                      * discussed in commit
                      * 2f833f5208e26b208886e51e09e2c072b5eabb46 */
-                    formatted = Perl_form(aTHX_
+                    name = savepv(Perl_form(aTHX_
                                           "%s%.*s%s\n",
                                           (FOLD) ? "__" : "",
                                           (int)n,
                                           RExC_parse,
                                           (FOLD) ? "_i" : ""
-                                );
-                    name = savepvn(formatted, strlen(formatted));
+                                ));
 
                     /* Look up the property name, and get its swash and
                      * inversion list, if the property is found  */