diff options
author | David Mitchell <davem@iabyn.com> | 2011-05-27 13:35:25 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-05-29 20:21:52 +0100 |
commit | 11f9eeafe5cba9d9e0c7aa0e94a6605fdc34b971 (patch) | |
tree | 3df9a0fcfb013a22120849638bbe5ad81c462346 | |
parent | b57b17349edad3eb77b8bbcdf1aee88b481e183f (diff) | |
download | perl-11f9eeafe5cba9d9e0c7aa0e94a6605fdc34b971.tar.gz |
pp_formline: combine two similar code chunks
FF_BLANK and FF_END do almost identical tidying up before returning
-rw-r--r-- | pp_ctl.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -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; } } } |