[Groonga-commit] groonga/groonga at dd6aeb5 [master] Revert "pat: fix unexpected count up"

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Oct 9 21:34:33 JST 2015


Kouhei Sutou	2015-10-09 21:34:33 +0900 (Fri, 09 Oct 2015)

  New Revision: dd6aeb567c4dfe238e928e205507fae5bb301992
  https://github.com/groonga/groonga/commit/dd6aeb567c4dfe238e928e205507fae5bb301992

  Message:
    Revert "pat: fix unexpected count up"
    
    This reverts commit b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d.
    
    It's unexpected commit on master. :<

  Modified files:
    lib/pat.c

  Modified: lib/pat.c (+5 -5)
===================================================================
--- lib/pat.c    2015-10-09 21:33:51 +0900 (73b92f5)
+++ lib/pat.c    2015-10-09 21:34:33 +0900 (e24dbe7)
@@ -703,10 +703,10 @@ _grn_pat_add(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t size, uint
     if (*lkey && size2) {
       if (pat->header->garbages[0]) {
         r = pat->header->garbages[0];
-        PAT_AT(pat, r, rn);
-        if (!rn) { return 0; }
         pat->header->n_entries++;
         pat->header->n_garbages--;
+        PAT_AT(pat, r, rn);
+        if (!rn) { return 0; }
         pat->header->garbages[0] = rn->lr[0];
       } else {
         if (!(rn = pat_node_new(ctx, pat, &r))) { return 0; }
@@ -718,12 +718,12 @@ _grn_pat_add(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t size, uint
       if (pat->header->garbages[size2]) {
         uint8_t *keybuf;
         r = pat->header->garbages[size2];
-        PAT_AT(pat, r, rn);
-        if (!rn) { return 0; }
-        if (!(keybuf = pat_node_get_key(ctx, pat, rn))) { return 0; }
         pat->header->n_entries++;
         pat->header->n_garbages--;
+        PAT_AT(pat, r, rn);
+        if (!rn) { return 0; }
         pat->header->garbages[size2] = rn->lr[0];
+        if (!(keybuf = pat_node_get_key(ctx, pat, rn))) { return 0; }
         PAT_LEN_SET(rn, size);
         grn_memcpy(keybuf, key, size);
       } else {
-------------- next part --------------
HTML����������������������������...
Download 



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