Splitting the -n/-p code and concatenating strings generates
Nicholas Clark [Sun, 2 Jan 2005 07:46:12 +0000 (07:46 +0000)]
smaller object code.

p4raw-id: //depot/perl@23729

toke.c

diff --git a/toke.c b/toke.c
index 8832d08..1aceaec 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -715,13 +715,15 @@ S_skipspace(pTHX_ register char *s)
                             (prevlen = SvCUR(PL_linestr)))) == Nullch)
        {
            /* end of file.  Add on the -p or -n magic */
-           if (PL_minus_n || PL_minus_p) {
-               sv_setpv(PL_linestr,PL_minus_p ?
-                        ";}continue{print or die qq(-p destination: $!\\n)" :
-                        "");
-               sv_catpv(PL_linestr,";}");
+           if (PL_minus_p) {
+               sv_setpv(PL_linestr,
+                        ";}continue{print or die qq(-p destination: $!\\n);}");
                PL_minus_n = PL_minus_p = 0;
            }
+           else if (PL_minus_n) {
+               sv_setpvn(PL_linestr, ";}", 2);
+               PL_minus_n = 0;
+           }
            else
                sv_setpvn(PL_linestr,";", 1);