From: K.Kosako Date: Wed, 3 Oct 2018 12:32:03 +0000 (+0900) Subject: use OPTIMIZE_STR_CASE_FOLD_FAST X-Git-Tag: v6.9.1~18^2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4dcd2a5102466f22fe061f0e6abbbdd5a4aaf7cc;p=onig use OPTIMIZE_STR_CASE_FOLD_FAST --- diff --git a/src/regcomp.c b/src/regcomp.c index 58ac85b..3dfd00c 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -5714,6 +5714,17 @@ set_optimize_exact(regex_t* reg, OptExact* e) if (e->case_fold) { reg->optimize = OPTIMIZE_STR_CASE_FOLD; +#ifdef USE_SUNDAY_QUICK_SEARCH_ALGORITHM + if (e->good_case_fold != 0) { + if (e->len >= 2) { + r = set_sunday_quick_search_skip_table(reg, 1, + reg->exact, reg->exact_end, + reg->map, &(reg->map_offset)); + if (r != 0) return r; + reg->optimize = OPTIMIZE_STR_CASE_FOLD_FAST; + } + } +#endif } else { int allow_reverse; @@ -5721,7 +5732,7 @@ set_optimize_exact(regex_t* reg, OptExact* e) allow_reverse = ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end); - if (e->len >= 3 || (e->len >= 2 && allow_reverse)) { + if (e->len >= 2 || (e->len >= 1 && allow_reverse)) { #ifdef USE_SUNDAY_QUICK_SEARCH_ALGORITHM r = set_sunday_quick_search_skip_table(reg, 0, reg->exact, reg->exact_end, reg->map, &(reg->map_offset));