summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-12-03 18:26:43 +0000
committerNicholas Clark <nick@ccl4.org>2004-12-03 18:26:43 +0000
commit70ec62655df91a127fc208eb77497a9be5917f1b (patch)
tree5020014913ad4db9d3e38e3cde63b6a5ac33fd18 /gv.c
parentef97f5b30528a5e4790713361751c0a1bbd94c48 (diff)
downloadperl-70ec62655df91a127fc208eb77497a9be5917f1b.tar.gz
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
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index e20f27890b..5ea5141f99 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 ||