From 70563e168c754cdb3be6df5b0000a29f506cdd2a Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Sun, 16 Mar 2014 12:17:18 +0000 Subject: [PATCH] re_intuit_start(): update comments in BmUSEFUL blk --- regexec.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/regexec.c b/regexec.c index c77f5b3..022b52b 100644 --- a/regexec.c +++ b/regexec.c @@ -1348,11 +1348,11 @@ Perl_re_intuit_start(pTHX_ ++BmUSEFUL(utf8_target ? prog->check_utf8 : prog->check_substr); /* hooray/5 */ } else { - /* The found string does not prohibit matching at strpos, - - no optimization of calling REx engine can be performed, - unless it was an MBOL and we are not after MBOL, - or a future STCLASS check will fail this. */ - if (!(prog->intflags & PREGf_NAUGHTY) /* XXXX If strpos moved? */ + /* The found rx_origin position does not prohibit matching at + * strpos, so calling intuit didn't gain us anything. Decrement + * the BmUSEFUL() count on the check substring, and if we reach + * zero, free it. */ + if (!(prog->intflags & PREGf_NAUGHTY) && (utf8_target ? ( prog->check_utf8 /* Could be deleted already */ && --BmUSEFUL(prog->check_utf8) < 0 @@ -1402,6 +1402,7 @@ Perl_re_intuit_start(pTHX_ return NULL; } + #define DECL_TRIE_TYPE(scan) \ const enum { trie_plain, trie_utf8, trie_utf8_fold, trie_latin_utf8_fold, \ trie_utf8_exactfa_fold, trie_latin_utf8_exactfa_fold } \ -- 2.7.4