Navigation Menu

Skip to content

Commit

Permalink
Reduce indent
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 25, 2018
1 parent e05ea41 commit a2815fc
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions lib/db.c
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit a2815fc

Please sign in to comment.