From: Nicholas Clark Date: Fri, 3 Dec 2004 18:26:43 +0000 (+0000) Subject: There are clearer ways of saying m/^[ab]$/ than strchr("ab", c) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70ec62655df91a127fc208eb77497a9be5917f1b;p=p5sagit%2Fp5-mst-13.2.git There are clearer ways of saying m/^[ab]$/ than strchr("ab", c) They seem to produce slightly smaller object code too. p4raw-id: //depot/perl@23604 --- diff --git a/gv.c b/gv.c index e20f278..5ea5141 100644 --- a/gv.c +++ b/gv.c @@ -740,7 +740,8 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) sv_type != SVt_PVGV && sv_type != SVt_PVFM && sv_type != SVt_PVIO && - !(len == 1 && sv_type == SVt_PV && strchr("ab",*name)) ) + !(len == 1 && sv_type == SVt_PV && + (*name == 'a' || *name == 'b')) ) { gvp = (GV**)hv_fetch(stash,name,len,0); if (!gvp ||