[Groonga-commit] groonga/groonga at aacc1ec [master] dump: split a long condition

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Fri Apr 3 15:00:48 JST 2015


Kouhei Sutou	2015-04-03 15:00:48 +0900 (Fri, 03 Apr 2015)

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

  Message:
    dump: split a long condition

  Modified files:
    lib/proc.c

  Modified: lib/proc.c (+14 -12)
===================================================================
--- lib/proc.c    2015-04-03 14:50:04 +0900 (ab66713)
+++ lib/proc.c    2015-04-03 15:00:48 +0900 (7b65370)
@@ -2982,22 +2982,24 @@ dump_records(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table)
     if (GRN_OBJ_INDEX_COLUMNP(columns[i])) {
       continue;
     }
+
     GRN_BULK_REWIND(&column_name);
     grn_column_name_(ctx, columns[i], &column_name);
-    if (((table->header.type == GRN_TABLE_HASH_KEY ||
-          table->header.type == GRN_TABLE_PAT_KEY ||
-          table->header.type == GRN_TABLE_DAT_KEY) &&
-         GRN_TEXT_LEN(&column_name) == GRN_COLUMN_NAME_ID_LEN &&
-         !memcmp(GRN_TEXT_VALUE(&column_name),
-                 GRN_COLUMN_NAME_ID,
-                 GRN_COLUMN_NAME_ID_LEN)) ||
-        (table->header.type == GRN_TABLE_NO_KEY &&
-         GRN_TEXT_LEN(&column_name) == GRN_COLUMN_NAME_KEY_LEN &&
-         !memcmp(GRN_TEXT_VALUE(&column_name),
-                 GRN_COLUMN_NAME_KEY,
-                 GRN_COLUMN_NAME_KEY_LEN))) {
+    if (GRN_TEXT_LEN(&column_name) == GRN_COLUMN_NAME_ID_LEN &&
+        memcmp(GRN_TEXT_VALUE(&column_name),
+               GRN_COLUMN_NAME_ID,
+               GRN_COLUMN_NAME_ID_LEN) == 0) {
       continue;
     }
+
+    if (table->header.type == GRN_TABLE_NO_KEY &&
+        GRN_TEXT_LEN(&column_name) == GRN_COLUMN_NAME_KEY_LEN &&
+        memcmp(GRN_TEXT_VALUE(&column_name),
+               GRN_COLUMN_NAME_KEY,
+               GRN_COLUMN_NAME_KEY_LEN) == 0) {
+      continue;
+    }
+
     GRN_PTR_PUT(ctx, &use_columns, columns[i]);
   }
 
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る