summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-27 19:12:46 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-27 19:12:46 +0000
commitb11f357e172c58160ed5ae754def443bbae9bacb (patch)
tree4e7d739e8d169c40c7ca48e161f17d7319cdcb00 /regexec.c
parentc344f3872918f026026ddab0fdc6bb0ef0a5b4d0 (diff)
downloadperl-b11f357e172c58160ed5ae754def443bbae9bacb.tar.gz
Shave off some more of the Unicode regex slowness.
p4raw-id: //depot/perl@17371
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 0c45fd011f..f196cb7cfd 100644
--- a/regexec.c
+++ b/regexec.c
@@ -4284,15 +4284,16 @@ Perl_regclass_swash(pTHX_ register regnode* node, bool doinit, SV** listsvp, SV
if (PL_regdata->what[n] == 's') {
SV *rv = (SV*)PL_regdata->data[n];
AV *av = (AV*)SvRV((SV*)rv);
+ SV **ary = AvARRAY(av);
SV **a, **b;
/* See the end of regcomp.c:S_reglass() for
* documentation of these array elements. */
- si = *av_fetch(av, 0, FALSE);
- a = av_fetch(av, 1, FALSE);
- b = av_fetch(av, 2, FALSE);
-
+ si = *ary;
+ a = SvTYPE(ary[1]) == SVt_RV ? &ary[1] : 0;
+ b = SvTYPE(ary[2]) == SVt_PVAV ? &ary[2] : 0;
+
if (a)
sw = *a;
else if (si && doinit) {