]> granicus.if.org Git - onig/commitdiff
refactoring
authorK.Kosako <kosako@sofnec.co.jp>
Fri, 26 Jul 2019 05:31:06 +0000 (14:31 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Fri, 26 Jul 2019 05:31:06 +0000 (14:31 +0900)
src/regcomp.c

index bb0bb85b05fb69f7bfedb4c09398f912c69bca37..259e48ac792288ea9d0f21e85d01674ef4bdf81e 100644 (file)
@@ -599,7 +599,7 @@ select_str_opcode(int mb_len, int str_len, int ignore_case)
 }
 
 static int
-is_simple_type_node(Node* node)
+is_strict_real_node(Node* node)
 {
   switch (NODE_TYPE(node)) {
   case NODE_STRING:
@@ -3620,7 +3620,7 @@ next_setup(Node* node, Node* next_node, regex_t* reg)
 #endif
       /* automatic posseivation a*b ==> (?>a*)b */
       if (qn->lower <= 1) {
-        if (is_simple_type_node(NODE_BODY(node))) {
+        if (is_strict_real_node(NODE_BODY(node))) {
           Node *x, *y;
           x = get_head_value_node(NODE_BODY(node), 0, reg);
           if (IS_NOT_NULL(x)) {
@@ -4783,7 +4783,7 @@ setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env)
             QuantNode* tqn = QUANT_(target);
             if (IS_INFINITE_REPEAT(tqn->upper) && tqn->lower <= 1 &&
                 tqn->greedy != 0) {  /* (?>a*), a*+ etc... */
-              if (is_simple_type_node(NODE_BODY(target)))
+              if (is_strict_real_node(NODE_BODY(target)))
                 NODE_STATUS_ADD(node, STOP_BT_SIMPLE_REPEAT);
             }
           }