[Groonga-commit] groonga/groonga at 0b96a19 [master] grn_pat: fix a bug that a pat is broken in deletion

Back to archive index

susumu.yata null+****@clear*****
Wed Oct 28 18:51:45 JST 2015


susumu.yata	2015-10-28 18:51:45 +0900 (Wed, 28 Oct 2015)

  New Revision: 0b96a19056bad41db8d3e277cc5b21ba78b63195
  https://github.com/groonga/groonga/commit/0b96a19056bad41db8d3e277cc5b21ba78b63195

  Message:
    grn_pat: fix a bug that a pat is broken in deletion
    
    GitHub: #421

  Modified files:
    lib/pat.c

  Modified: lib/pat.c (+6 -0)
===================================================================
--- lib/pat.c    2015-10-28 16:52:58 +0900 (22b72ac)
+++ lib/pat.c    2015-10-28 18:51:45 +0900 (827406b)
@@ -1219,6 +1219,12 @@ _grn_pat_del(grn_ctx *ctx, grn_pat *pat, const char *key, uint32_t key_size, int
       }
     }
     *p0 = otherside;
+  } else if ((!rn->lr[0] && rn->lr[1] == r) ||
+             (!rn->lr[1] && rn->lr[0] == r)) {
+    /* The output node has only a disabled self-loop. */
+    di->stat = DL_PHASE2;
+    di->d = r;
+    *p = 0;
   } else {
     /* The last transition (p) is not a self-loop. */
     grn_pat_delinfo *ldi = NULL, *ddi = NULL;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index