[Groonga-commit] groonga/groonga at da13a20 [master] pat: key==0 is valid value...

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Nov 2 17:52:34 JST 2015


Kouhei Sutou	2015-11-02 17:52:34 +0900 (Mon, 02 Nov 2015)

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

  Message:
    pat: key==0 is valid value...

  Modified files:
    lib/pat.c

  Modified: lib/pat.c (+4 -4)
===================================================================
--- lib/pat.c    2015-11-02 17:36:15 +0900 (0509fcb)
+++ lib/pat.c    2015-11-02 17:52:34 +0900 (c6f30e7)
@@ -268,19 +268,19 @@ pat_node_get_key(grn_ctx *ctx, grn_pat *pat, pat_node *n)
 inline static grn_rc
 pat_node_set_key(grn_ctx *ctx, grn_pat *pat, pat_node *n, const uint8_t *key, uint32_t len)
 {
+  grn_rc rc;
   if (!key || !len) { return GRN_INVALID_ARGUMENT; }
   PAT_LEN_SET(n, len);
   if (len <= sizeof(uint32_t)) {
     PAT_IMD_ON(n);
     grn_memcpy(&n->key, key, len);
+    rc = GRN_SUCCESS;
   } else {
     PAT_IMD_OFF(n);
     n->key = key_put(ctx, pat, key, len);
-    if (n->key == 0) {
-      return ctx->rc;
-    }
+    rc = ctx->rc;
   }
-  return GRN_SUCCESS;
+  return rc;
 }
 
 /* delinfo operation */
-------------- next part --------------
HTML����������������������������...
Download 



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