summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGisle Aas <gisle@activestate.com>2005-12-28 12:38:03 +0000
committerGisle Aas <gisle@activestate.com>2005-12-28 12:38:03 +0000
commite81b061508e67c847690930e86f0a3899c902c62 (patch)
treed83d8a0f31d160ee858de818cdcbf7347c489357 /toke.c
parent4c8626beeba549aaf3f327729c56a599716ee8b7 (diff)
downloadperl-e81b061508e67c847690930e86f0a3899c902c62.tar.gz
Use memchr() instead of ninstr() to locate the end-of-line.
The call to memchr() will faster. p4raw-id: //depot/perl@26512
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index 6f5441622a..95669a9568 100644
--- a/toke.c
+++ b/toke.c
@@ -9706,7 +9706,6 @@ S_scan_heredoc(pTHX_ register char *s)
I32 len;
SV *tmpstr;
char term;
- const char newline[] = "\n";
const char *found_newline;
register char *d;
register char *e;
@@ -9768,7 +9767,7 @@ S_scan_heredoc(pTHX_ register char *s)
s = olds;
}
#endif
- if ( outer || !(found_newline = ninstr(s,PL_bufend,newline,newline+1)) ) {
+ if ( outer || !(found_newline = memchr(s, '\n', PL_bufend - s)) ) {
herewas = newSVpvn(s,PL_bufend-s);
}
else {