diff options
author | Richard Leach <richardleach@users.noreply.github.com> | 2021-02-01 01:01:29 +0000 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-02-09 08:34:06 -0800 |
commit | 07b740f3e29869abb3e282fe6064fdd08a76b6ff (patch) | |
tree | 5d5c0a656f95bb4ff1a47703ffb754df42d808b3 /pp.c | |
parent | fa3bc4a32c3d8e7ca6fc27d71694893cc33b6858 (diff) | |
download | perl-07b740f3e29869abb3e282fe6064fdd08a76b6ff.tar.gz |
pp_split: realarray to bool, multiline to scoped const
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -6007,14 +6007,13 @@ PP(pp_split) I32 trailing_empty = 0; const char *orig; const IV origlimit = limit; - I32 realarray = 0; + bool realarray = 0; I32 base; const U8 gimme = GIMME_V; bool gimme_scalar; I32 oldsave = PL_savestack_ix; U32 flags = (do_utf8 ? SVf_UTF8 : 0) | SVs_TEMP; /* Make mortal SVs by default */ - bool multiline = 0; MAGIC *mg = NULL; rx = PM_GETRE(pm); @@ -6078,9 +6077,6 @@ PP(pp_split) s++; } } - if (RX_EXTFLAGS(rx) & RXf_PMf_MULTILINE) { - multiline = 1; - } gimme_scalar = gimme == G_SCALAR && !ary; @@ -6256,6 +6252,8 @@ PP(pp_split) } } else { + const bool multiline = (RX_EXTFLAGS(rx) & RXf_PMf_MULTILINE) ? 1 : 0; + while (s < strend && --limit && (m = fbm_instr((unsigned char*)s, (unsigned char*)strend, csv, multiline ? FBMrf_MULTILINE : 0)) ) |