From: Gisle Aas Date: Wed, 28 Dec 2005 12:38:03 +0000 (+0000) Subject: Use memchr() instead of ninstr() to locate the end-of-line. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e81b061508e67c847690930e86f0a3899c902c62;p=p5sagit%2Fp5-mst-13.2.git Use memchr() instead of ninstr() to locate the end-of-line. The call to memchr() will faster. p4raw-id: //depot/perl@26512 --- diff --git a/toke.c b/toke.c index 6f54416..95669a9 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 {