summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-12-31 22:46:25 +0000
committerNicholas Clark <nick@ccl4.org>2004-12-31 22:46:25 +0000
commit82833bd28d841ea98ad257b55eadb49e3ab00141 (patch)
tree76c661570b70508bd2ff532ca2b691f73317fb25 /doio.c
parent511878ee21c784b9eba288b294e11c9bbf19193e (diff)
downloadperl-82833bd28d841ea98ad257b55eadb49e3ab00141.tar.gz
Doing the strnEQ char by char for 2 and 3 character strings
generates a smaller object file, and will be faster. p4raw-id: //depot/perl@23721
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/doio.c b/doio.c
index 70b35359c4..5e568ed50b 100644
--- a/doio.c
+++ b/doio.c
@@ -1141,7 +1141,7 @@ Perl_mode_from_discipline(pTHX_ SV *discp)
if (*s == ':') {
switch (s[1]) {
case 'r':
- if (len > 3 && strnEQ(s+1, "raw", 3)
+ if (s[2] == 'a' && s[3] == 'w'
&& (!s[4] || s[4] == ':' || isSPACE(s[4])))
{
mode = O_BINARY;
@@ -1151,7 +1151,7 @@ Perl_mode_from_discipline(pTHX_ SV *discp)
}
/* FALL THROUGH */
case 'c':
- if (len > 4 && strnEQ(s+1, "crlf", 4)
+ if (s[2] == 'r' && s[3] == 'l' && s[4] == 'f'
&& (!s[5] || s[5] == ':' || isSPACE(s[5])))
{
mode = O_TEXT;