[Groonga-commit] groonga/groonga at e977698 [master] Use easy to debug macro

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Aug 30 18:14:41 JST 2016


Kouhei Sutou	2016-08-30 18:14:41 +0900 (Tue, 30 Aug 2016)

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

  Message:
    Use easy to debug macro

  Modified files:
    lib/db.c

  Modified: lib/db.c (+7 -4)
===================================================================
--- lib/db.c    2016-08-30 18:14:30 +0900 (f7ed1e2)
+++ lib/db.c    2016-08-30 18:14:41 +0900 (3ec141e)
@@ -8900,9 +8900,12 @@ remove_columns(grn_ctx *ctx, grn_obj *obj)
   if ((cols = grn_hash_create(ctx, NULL, sizeof(grn_id), 0,
                               GRN_OBJ_TABLE_HASH_KEY|GRN_HASH_TINY))) {
     if (grn_table_columns(ctx, obj, "", 0, (grn_obj *)cols)) {
-      grn_id *key;
-      GRN_HASH_EACH(ctx, cols, id, &key, NULL, NULL, {
-        grn_obj *col = grn_ctx_at(ctx, *key);
+      GRN_HASH_EACH_BEGIN(ctx, cols, cursor, id) {
+        grn_id *key;
+        grn_obj *col;
+
+        grn_hash_cursor_get_key(ctx, cursor, (void **)&key);
+        col = grn_ctx_at(ctx, *key);
 
         if (!col) {
           char name[GRN_TABLE_MAX_KEY_SIZE];
@@ -8928,7 +8931,7 @@ remove_columns(grn_ctx *ctx, grn_obj *obj)
           grn_obj_unlink(ctx, col);
           break;
         }
-      });
+      } GRN_HASH_EACH_END(ctx, cursor);
     }
     grn_hash_close(ctx, cols);
   }
-------------- next part --------------
HTML����������������������������...
Download 



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