From 11f9eeafe5cba9d9e0c7aa0e94a6605fdc34b971 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Fri, 27 May 2011 13:35:25 +0100 Subject: [PATCH] pp_formline: combine two similar code chunks FF_BLANK and FF_END do almost identical tidying up before returning --- pp_ctl.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pp_ctl.c b/pp_ctl.c index 79b7d32caa..2817c12bb2 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1018,14 +1018,8 @@ PP(pp_formline) arg = *fpc++; if (gotsome) { if (arg) { /* repeat until fields exhausted? */ - *t = '\0'; - SvCUR_set(PL_formtarget, t - SvPVX_const(PL_formtarget)); - lines += FmLINES(PL_formtarget); - if (targ_is_utf8) - SvUTF8_on(PL_formtarget); - FmLINES(PL_formtarget) = lines; - SP = ORIGMARK; - RETURNOP(cLISTOP->op_first); + fpc--; + goto end; } } else { @@ -1062,13 +1056,17 @@ PP(pp_formline) break; } case FF_END: + end: *t = '\0'; SvCUR_set(PL_formtarget, t - SvPVX_const(PL_formtarget)); if (targ_is_utf8) SvUTF8_on(PL_formtarget); FmLINES(PL_formtarget) += lines; SP = ORIGMARK; - RETPUSHYES; + if (fpc[-1] == FF_BLANK) + RETURNOP(cLISTOP->op_first); + else + RETPUSHYES; } } } -- 2.34.1