[Groonga-commit] groonga/groonga at 4076ba1 [master] dump: indent

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jul 14 15:51:38 JST 2017


Kouhei Sutou	2017-07-14 15:51:38 +0900 (Fri, 14 Jul 2017)

  New Revision: 4076ba14f118a19a4a9695249cf1ea3132de213a
  https://github.com/groonga/groonga/commit/4076ba14f118a19a4a9695249cf1ea3132de213a

  Message:
    dump: indent

  Modified files:
    lib/proc/proc_dump.c

  Modified: lib/proc/proc_dump.c (+17 -17)
===================================================================
--- lib/proc/proc_dump.c    2017-07-14 15:51:10 +0900 (68d57a1)
+++ lib/proc/proc_dump.c    2017-07-14 15:51:38 +0900 (edb0b76)
@@ -666,25 +666,25 @@ dump_records(grn_ctx *ctx, grn_dumper *dumper, grn_obj *table)
     for (i = 0; (id = grn_table_cursor_next(ctx, cursor)) != GRN_ID_NIL;
          ++i, old_id = id) {
 
-    if (i) { GRN_TEXT_PUTS(ctx, dumper->output, ",\n"); }
-    if (table->header.type == GRN_TABLE_NO_KEY && old_id + 1 < id) {
-      grn_id current_id;
-      for (current_id = old_id + 1; current_id < id; current_id++) {
-        GRN_TEXT_PUTS(ctx, dumper->output, "[],\n");
-        GRN_TEXT_PUTS(ctx, &delete_commands, "delete --table ");
-        dump_obj_name_raw(ctx, &delete_commands, table);
-        GRN_TEXT_PUTS(ctx, &delete_commands, " --id ");
-        grn_text_lltoa(ctx, &delete_commands, current_id);
-        GRN_TEXT_PUTC(ctx, &delete_commands, '\n');
+      if (i) { GRN_TEXT_PUTS(ctx, dumper->output, ",\n"); }
+      if (table->header.type == GRN_TABLE_NO_KEY && old_id + 1 < id) {
+        grn_id current_id;
+        for (current_id = old_id + 1; current_id < id; current_id++) {
+          GRN_TEXT_PUTS(ctx, dumper->output, "[],\n");
+          GRN_TEXT_PUTS(ctx, &delete_commands, "delete --table ");
+          dump_obj_name_raw(ctx, &delete_commands, table);
+          GRN_TEXT_PUTS(ctx, &delete_commands, " --id ");
+          grn_text_lltoa(ctx, &delete_commands, current_id);
+          GRN_TEXT_PUTC(ctx, &delete_commands, '\n');
+        }
       }
+      dump_record(ctx, dumper, table, id, &columns, n_columns);
     }
-    dump_record(ctx, dumper, table, id, &columns, n_columns);
-  }
-  grn_table_cursor_close(ctx, cursor);
-  GRN_TEXT_PUTS(ctx, dumper->output, "\n]\n");
-  GRN_TEXT_PUT(ctx, dumper->output, GRN_TEXT_VALUE(&delete_commands),
-                            GRN_TEXT_LEN(&delete_commands));
-  GRN_OBJ_FIN(ctx, &delete_commands);
+    grn_table_cursor_close(ctx, cursor);
+    GRN_TEXT_PUTS(ctx, dumper->output, "\n]\n");
+    GRN_TEXT_PUT(ctx, dumper->output, GRN_TEXT_VALUE(&delete_commands),
+                              GRN_TEXT_LEN(&delete_commands));
+    GRN_OBJ_FIN(ctx, &delete_commands);
   }
 exit :
   for (i = 0; i < n_columns; i++) {
-------------- next part --------------
HTML����������������������������...
Télécharger 



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