From 3577cbfae9e3b6bf7d749247cbee7914238e15ad Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Sat, 22 Sep 2018 17:03:03 +0900 Subject: [PATCH] refactoring --- src/regcomp.c | 5 ++--- src/regexec.c | 17 +++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/regcomp.c b/src/regcomp.c index ffe8710..fc2b48f 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -4554,7 +4554,7 @@ setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env) /* set skip map for Boyer-Moore-Horspool search */ static int -set_bm_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED, UChar skip[]) +set_bmh_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED, UChar skip[]) { int i, len; @@ -5559,8 +5559,7 @@ 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_bm_skip(reg->exact, reg->exact_end, reg->enc, - reg->map); + r = set_bmh_skip(reg->exact, reg->exact_end, reg->enc, reg->map); if (r != 0) return r; reg->optimize = (allow_reverse != 0 diff --git a/src/regexec.c b/src/regexec.c index 0353be0..ce60cf8 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -4113,16 +4113,17 @@ slow_search_backward_ic(OnigEncoding enc, int case_fold_flag, } static UChar* -bm_search_forward(regex_t* reg, const UChar* target, const UChar* target_end, - const UChar* text, const UChar* text_end, - const UChar* text_range) +bmh_search_forward(regex_t* reg, const UChar* target, const UChar* target_end, + const UChar* text, const UChar* text_end, + const UChar* text_range) { const UChar *s, *se, *t, *p, *end; const UChar *tail; int skip, tlen1; #ifdef ONIG_DEBUG_SEARCH - fprintf(stderr, "bm_search_forward: text: %p, text_end: %p, text_range: %p\n", + fprintf(stderr, + "bmh_search_forward: text: %p, text_end: %p, text_range: %p\n", text, text_end, text_range); #endif @@ -4152,8 +4153,8 @@ bm_search_forward(regex_t* reg, const UChar* target, const UChar* target_end, } static UChar* -bm_search(regex_t* reg, const UChar* target, const UChar* target_end, - const UChar* text, const UChar* text_end, const UChar* text_range) +bmh_search(regex_t* reg, const UChar* target, const UChar* target_end, + const UChar* text, const UChar* text_end, const UChar* text_range) { const UChar *s, *t, *p, *end; const UChar *tail; @@ -4292,11 +4293,11 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s, break; case OPTIMIZE_EXACT_BMH: - p = bm_search(reg, reg->exact, reg->exact_end, p, end, range); + p = bmh_search(reg, reg->exact, reg->exact_end, p, end, range); break; case OPTIMIZE_EXACT_BMH_FORWARD: - p = bm_search_forward(reg, reg->exact, reg->exact_end, p, end, range); + p = bmh_search_forward(reg, reg->exact, reg->exact_end, p, end, range); break; case OPTIMIZE_MAP: -- 2.40.0