From be00751c6b8da9d4fc5eb41e145e8453a3b51fba Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Sat, 22 Sep 2018 22:59:20 +0900 Subject: [PATCH] refactoring --- src/regcomp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/regcomp.c b/src/regcomp.c index f16e975..7fb83be 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -4553,8 +4553,10 @@ setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env) } #ifdef USE_SUNDAY_QUICK_SEARCH_ALGORITHM +/* set skip map for Sunday quick search */ static int -set_bmh_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED, UChar skip[]) +set_search_skip_table(UChar* s, UChar* end, + OnigEncoding enc ARG_UNUSED, UChar skip[]) { int i, len; @@ -4572,7 +4574,8 @@ set_bmh_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED, UChar skip[]) #else /* set skip map for Boyer-Moore-Horspool search */ static int -set_bmh_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED, UChar skip[]) +set_search_skip_table(UChar* s, UChar* end, + OnigEncoding enc ARG_UNUSED, UChar skip[]) { int i, len; @@ -5579,7 +5582,8 @@ set_optimize_exact(regex_t* reg, OptExact* e) ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end); if (e->len >= 3 || (e->len >= 2 && allow_reverse)) { - r = set_bmh_skip(reg->exact, reg->exact_end, reg->enc, reg->map); + r = set_search_skip_table(reg->exact, reg->exact_end, + reg->enc, reg->map); if (r != 0) return r; reg->optimize = (allow_reverse != 0 -- 2.50.1