diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-21 01:45:15 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-21 14:11:03 -0700 |
commit | 5bd13da38ce1da800b0c3011ce3201c3b88541c3 (patch) | |
tree | 41c60db6c0b537c50d7fba95e5e9e3ad59f83cac | |
parent | 7cc341114c4476436b593500ef63fa0925f746ca (diff) | |
download | perl-5bd13da38ce1da800b0c3011ce3201c3b88541c3.tar.gz |
toke.c:scan_heredoc: Use PL_tokenbuf less
When scanning for a heredoc terminator in a string eval or quote-like
operator, the first character we are looking for is always a newline.
So instead of setting term to *PL_tokenbuf in those two code paths,
we can just hard-code '\n'.
-rw-r--r-- | toke.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -9656,10 +9656,9 @@ S_scan_heredoc(pTHX_ register char *s) break; } } - term = *PL_tokenbuf; d = s; while (s < bufend && - (*s != term || memNE(s,PL_tokenbuf,len)) ) { + (*s != '\n' || memNE(s,PL_tokenbuf,len)) ) { if (*s++ == '\n') CopLINE_inc(PL_curcop); } @@ -9680,10 +9679,9 @@ S_scan_heredoc(pTHX_ register char *s) goto retval; } else if (!infile || found_newline) { - term = *PL_tokenbuf; d = s; while (s < PL_bufend && - (*s != term || memNE(s,PL_tokenbuf,len)) ) { + (*s != '\n' || memNE(s,PL_tokenbuf,len)) ) { if (*s++ == '\n') CopLINE_inc(PL_curcop); } |