Navigation Menu

Skip to content

Commit

Permalink
mrb: move index resolve code on match to mruby
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 9, 2014
1 parent e225506 commit 3dc3672
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
17 changes: 2 additions & 15 deletions lib/mrb/mrb_expr.c
Expand Up @@ -238,21 +238,8 @@ scan_info_build(grn_ctx *ctx, grn_obj *expr, int *n,
mrb_value mrb_db_obj = grn_mrb_value_from_grn_obj(mrb, *p);
mrb_funcall(mrb, mrb_si, "match_resolve_index_db_obj", 1, mrb_db_obj);
} else if (GRN_ACCESSORP(*p)) {
grn_scan_info_set_flags(si, grn_scan_info_get_flags(si) | SCAN_ACCESSOR);
if (grn_column_index(ctx, *p, c->op, &index, 1, &sid)) {
mrb_value mrb_accessor = grn_mrb_value_from_grn_obj(mrb, *p);
if (!mrb_nil_p(mrb_funcall(mrb, mrb_accessor, "next", 0))) {
mrb_funcall(mrb, mrb_si, "put_index", 3,
mrb_accessor,
mrb_fixnum_value(sid),
mrb_fixnum_value(1));
} else {
mrb_funcall(mrb, mrb_si, "put_index", 3,
grn_mrb_value_from_grn_obj(mrb, index),
mrb_fixnum_value(sid),
mrb_fixnum_value(1));
}
}
mrb_value mrb_accessor = grn_mrb_value_from_grn_obj(mrb, *p);
mrb_funcall(mrb, mrb_si, "match_resolve_index_accessor", 1, mrb_accessor);
} else {
mrb_value mrb_query;
mrb_query = grn_mrb_value_from_grn_obj(mrb, *p);
Expand Down
2 changes: 1 addition & 1 deletion lib/mrb/scripts/scan_info.rb
Expand Up @@ -28,7 +28,7 @@ def match_resolve_index_accessor(accessor)
self.flags |= Flags::ACCESSOR
index_info = accessor.find_index(op)
return if index_info.nil?
if acessor.next
if accessor.next
put_index(accessor, index_info.section_id, 1)
else
put_index(index_info.index, index_info.section_id, 1)
Expand Down

0 comments on commit 3dc3672

Please sign in to comment.