summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-27 20:53:44 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-27 20:53:44 +0000
commitcc07378bd850d5f9faaa12b44277d091729e30f0 (patch)
tree7a1af794cf57f3e7385b9692605bc8f94430a1d9 /regexec.c
parentb11f357e172c58160ed5ae754def443bbae9bacb (diff)
downloadperl-cc07378bd850d5f9faaa12b44277d091729e30f0.tar.gz
Inlining to avoid costly UTF-8 calls.
p4raw-id: //depot/perl@17372
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/regexec.c b/regexec.c
index f196cb7cfd..389fa1d669 100644
--- a/regexec.c
+++ b/regexec.c
@@ -4328,12 +4328,13 @@ S_reginclass(pTHX_ register regnode *n, register U8* p, STRLEN* lenp, register b
{
char flags = ANYOF_FLAGS(n);
bool match = FALSE;
- UV c;
+ UV c = *p;
STRLEN len = 0;
STRLEN plen;
- c = do_utf8 ? utf8n_to_uvchr(p, UTF8_MAXLEN, &len,
- ckWARN(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY) : *p;
+ if (do_utf8 && !UTF8_IS_INVARIANT(c))
+ c = utf8n_to_uvchr(p, UTF8_MAXLEN, &len,
+ ckWARN(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY);
plen = lenp ? *lenp : UNISKIP(NATIVE_TO_UNI(c));
if (do_utf8 || (flags & ANYOF_UNICODE)) {