summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-12-03 20:07:31 +0000
committerNicholas Clark <nick@ccl4.org>2004-12-03 20:07:31 +0000
commit3792a11b372a7ebb936a206658c45be7271a102f (patch)
treee1ae71351aafa54ee7577e5c00e8b5e84bc4616f /perl.c
parent9dde0ab5b19ba4c8e14ce23a6ead155daca1526e (diff)
downloadperl-3792a11b372a7ebb936a206658c45be7271a102f.tar.gz
use (c == '$' || c == '@' || c == '%') instead of strchr("$@%", c)
The latter gives larger code, is less clear and can't be any faster p4raw-id: //depot/perl@23606
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index e10fe78903..4c7b45f9e9 100644
--- a/perl.c
+++ b/perl.c
@@ -3428,7 +3428,8 @@ S_validate_suid(pTHX_ char *validarg, char *scriptname)
/* Sanity check on buffer end */
while ((*s) && !isSPACE(*s)) s++;
for (s2 = s; (s2 > SvPV(PL_linestr,n_a)+2 &&
- (isDIGIT(s2[-1]) || strchr("._-", s2[-1]))); s2--) ;
+ (isDIGIT(s2[-1]) || s2[-1] == '.' || s2[-1] == '_'
+ || s2[-1] == '-')); s2--) ;
/* Sanity check on buffer start */
if ( (s2-4 < SvPV(PL_linestr,n_a)+2 || strnNE(s2-4,"perl",4)) &&
(s-9 < SvPV(PL_linestr,n_a)+2 || strnNE(s-9,"perl",4)) )
@@ -3715,7 +3716,8 @@ S_find_beginning(pTHX)
s2 = s;
while (*s == ' ' || *s == '\t') s++;
if (*s++ == '-') {
- while (isDIGIT(s2[-1]) || strchr("-._", s2[-1])) s2--;
+ while (isDIGIT(s2[-1]) || s2[-1] == '-' || s2[-1] == '.'
+ || s2[-1] == '_') s2--;
if (strnEQ(s2-4,"perl",4))
/*SUPPRESS 530*/
while ((s = moreswitches(s)))