diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-27 20:53:44 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-27 20:53:44 +0000 |
commit | cc07378bd850d5f9faaa12b44277d091729e30f0 (patch) | |
tree | 7a1af794cf57f3e7385b9692605bc8f94430a1d9 /regexec.c | |
parent | b11f357e172c58160ed5ae754def443bbae9bacb (diff) | |
download | perl-cc07378bd850d5f9faaa12b44277d091729e30f0.tar.gz |
Inlining to avoid costly UTF-8 calls.
p4raw-id: //depot/perl@17372
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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)) { |