diff options
author | Yves Orton <demerphq@gmail.com> | 2006-10-20 14:38:13 +0200 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2006-10-20 13:00:52 +0000 |
commit | 526550006a9e67e99d92fcb1eb05fe7b52d5172a (patch) | |
tree | 2d1778b7b522d7965eaa97a25b5a056482bc67cc /mg.c | |
parent | 676456c20d9092c3a5249acd38ce7d71e3ddeba8 (diff) | |
download | perl-526550006a9e67e99d92fcb1eb05fe7b52d5172a.tar.gz |
only do \C hackery if \C is seen
Subject: Re: utf8 regexp performance problem
Message-ID: <9b18b3110610200338k5df1d3afpf829fbc0f3663a75@mail.gmail.com>
p4raw-id: //depot/perl@29063
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -861,8 +861,13 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) TAINT_NOT; sv_setpvn(sv, s, i); PL_tainted = oldtainted; - if (RX_MATCH_UTF8(rx) && (!i || is_utf8_string((U8*)s, i))) + if ( (rx->reganch & ROPT_CANY_SEEN) + ? (RX_MATCH_UTF8(rx) + && (!i || is_utf8_string((U8*)s, i))) + : (RX_MATCH_UTF8(rx)) ) + { SvUTF8_on(sv); + } else SvUTF8_off(sv); if (PL_tainting) { |