[Groonga-commit] groonga/groonga at b60f1d9 [master] dump: reduce scope

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jul 14 15:52:44 JST 2017


Kouhei Sutou	2017-07-14 15:52:44 +0900 (Fri, 14 Jul 2017)

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

  Message:
    dump: reduce scope

  Modified files:
    lib/proc/proc_dump.c

  Modified: lib/proc/proc_dump.c (+2 -3)
===================================================================
--- lib/proc/proc_dump.c    2017-07-14 15:51:55 +0900 (661a775)
+++ lib/proc/proc_dump.c    2017-07-14 15:52:44 +0900 (933f5ad)
@@ -506,7 +506,6 @@ dump_records(grn_ctx *ctx, grn_dumper *dumper, grn_obj *table)
   grn_table_cursor *cursor;
   int i, n_columns;
   grn_obj columns;
-  grn_obj delete_commands;
   grn_bool have_index_column = GRN_FALSE;
   grn_bool have_data_column = GRN_FALSE;
 
@@ -614,8 +613,6 @@ dump_records(grn_ctx *ctx, grn_dumper *dumper, grn_obj *table)
   }
   GRN_TEXT_PUTS(ctx, dumper->output, "],\n");
 
-  GRN_TEXT_INIT(&delete_commands, 0);
-
   if (table->header.type == GRN_TABLE_HASH_KEY && dumper->is_sort_hash_table) {
     grn_obj *sorted;
     grn_table_sort_key *sort_keys;
@@ -658,9 +655,11 @@ dump_records(grn_ctx *ctx, grn_dumper *dumper, grn_obj *table)
     GRN_TEXT_PUTS(ctx, dumper->output, "\n]\n");
     grn_table_sort_key_close(ctx, sort_keys, n_sort_keys);
   } else {
+    grn_obj delete_commands;
     grn_id old_id = GRN_ID_NIL;
     grn_id id;
 
+    GRN_TEXT_INIT(&delete_commands, 0);
     cursor = grn_table_cursor_open(ctx, table, NULL, 0, NULL, 0, 0, -1,
                                    GRN_CURSOR_BY_KEY);
     for (i = 0; (id = grn_table_cursor_next(ctx, cursor)) != GRN_ID_NIL;
-------------- next part --------------
HTML����������������������������...
Download 



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