[Groonga-commit] groonga/groonga at a2815fc [master] Reduce indent

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jun 25 11:02:05 JST 2018


Kouhei Sutou	2018-06-25 11:02:05 +0900 (Mon, 25 Jun 2018)

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

  Merged 8a52f23: Merge pull request #850 from komainu8/add_check_exist_with_section_flag

  Message:
    Reduce indent

  Modified files:
    lib/db.c

  Modified: lib/db.c (+17 -20)
===================================================================
--- lib/db.c    2018-06-25 10:56:48 +0900 (ecc1fcd46)
+++ lib/db.c    2018-06-25 11:02:05 +0900 (f445d2425)
@@ -8827,27 +8827,24 @@ grn_obj_set_info_source_validate(grn_ctx *ctx, grn_obj *obj, grn_obj *value)
 
   source_ids = (grn_id *)GRN_BULK_HEAD(value);
   n_source_ids = GRN_BULK_VSIZE(value) / sizeof(grn_id);
-  if (grn_obj_is_index_column(ctx, obj)) {
-    if (n_source_ids == 1) {
-      grn_obj *source;
+  if (grn_obj_is_index_column(ctx, obj) && n_source_ids == 1) {
+    grn_obj *source;
 
-      source = grn_ctx_at(ctx, source_ids[0]);
-      if (grn_obj_is_vector_column(ctx, source)) {
-        if ((obj->header.flags & GRN_OBJ_WITH_POSITION)
-            && (lexicon_have_tokenizer)) {
-          if (!(obj->header.flags & GRN_OBJ_WITH_SECTION)) {
-            char index_name[GRN_TABLE_MAX_KEY_SIZE];
-            int index_name_size;
-            index_name_size = grn_obj_name(ctx, obj,
-                                           index_name, GRN_TABLE_MAX_KEY_SIZE);
-            ERR(GRN_INVALID_ARGUMENT,
-                "grn_obj_set_info(): GRN_INFO_SOURCE: "
-                "full text index for vector column must be created with WITH_SECTION flag: <%.*s>",
-                index_name_size, index_name);
-            goto exit;
-          }
-        }
-      }
+    source = grn_ctx_at(ctx, source_ids[0]);
+    if (grn_obj_is_vector_column(ctx, source) &&
+        (obj->header.flags & GRN_OBJ_WITH_POSITION) &&
+        lexicon_have_tokenizer &&
+        !(obj->header.flags & GRN_OBJ_WITH_SECTION)) {
+      char index_name[GRN_TABLE_MAX_KEY_SIZE];
+      int index_name_size;
+      index_name_size = grn_obj_name(ctx, obj,
+                                     index_name, GRN_TABLE_MAX_KEY_SIZE);
+      ERR(GRN_INVALID_ARGUMENT,
+          "grn_obj_set_info(): GRN_INFO_SOURCE: "
+          "full text index for vector column "
+          "must be created with WITH_SECTION flag: <%.*s>",
+          index_name_size, index_name);
+      goto exit;
     }
   }
 
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180625/b202c8f8/attachment-0001.htm 



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