From: Nicholas Clark Date: Sun, 2 Jan 2005 07:46:12 +0000 (+0000) Subject: Splitting the -n/-p code and concatenating strings generates X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=01a19ab0a2917aedc73dc22d27746912f8baa335;p=p5sagit%2Fp5-mst-13.2.git Splitting the -n/-p code and concatenating strings generates smaller object code. p4raw-id: //depot/perl@23729 --- diff --git a/toke.c b/toke.c index 8832d08..1aceaec 100644 --- 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);