[Groonga-commit] groonga/groonga at e758c45 [master] pat: use "r0 == GRN_ID_NIL" instead of "ctx->rc" to check failure

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Nov 2 18:42:56 JST 2015


Kouhei Sutou	2015-11-02 18:42:56 +0900 (Mon, 02 Nov 2015)

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

  Message:
    pat: use "r0 == GRN_ID_NIL" instead of "ctx->rc" to check failure

  Modified files:
    lib/pat.c

  Modified: lib/pat.c (+1 -1)
===================================================================
--- lib/pat.c    2015-11-02 18:42:14 +0900 (896d813)
+++ lib/pat.c    2015-11-02 18:42:56 +0900 (8fd0149)
@@ -922,7 +922,7 @@ grn_pat_add(grn_ctx *ctx, grn_pat *pat, const void *key, uint32_t key_size,
   }
   KEY_ENCODE(pat, keybuf, key, key_size);
   r0 = _grn_pat_add(ctx, pat, (uint8_t *)key, key_size, &new, &lkey);
-  if (ctx->rc) { return GRN_ID_NIL; }
+  if (r0 == GRN_ID_NIL) { return GRN_ID_NIL; }
   if (added) { *added = new; }
   if (r0 && (pat->obj.header.flags & GRN_OBJ_KEY_WITH_SIS) &&
       (*((uint8_t *)key) & 0x80)) { // todo: refine!!
-------------- next part --------------
HTML����������������������������...
Download 



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