Navigation Menu

Skip to content

Commit

Permalink
expr scan_info: use "start" value as the default "end" value
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 15, 2018
1 parent 142d09e commit e368cf6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/expr.c
Expand Up @@ -3981,6 +3981,7 @@ struct _grn_scan_info {
(si)->similarity_threshold = DEFAULT_SIMILARITY_THRESHOLD;\
(si)->quorum_threshold = DEFAULT_QUORUM_THRESHOLD;\
(si)->start = (st);\
(si)->end = (st);\
(si)->query = NULL;\
GRN_PTR_INIT(&(si)->scorers, GRN_OBJ_VECTOR, GRN_ID_NIL);\
GRN_PTR_INIT(&(si)->scorer_args_exprs, GRN_OBJ_VECTOR, GRN_ID_NIL);\
Expand Down
3 changes: 0 additions & 3 deletions lib/mrb/scripts/scan_info_builder.rb
Expand Up @@ -78,7 +78,6 @@ def build
if context.status == :const
data = context.data
data.op = Operator::PUSH
data.end = data.start
@data_list << data
context.data = nil
end
Expand All @@ -100,7 +99,6 @@ def build
if code.modify > 0 and
LOGICAL_OPERATORS.include?(codes[i + code.modify].op)
data.op = Operator::PUSH
data.end = data.start
@data_list << data
context.data = nil
context.status = :start
Expand Down Expand Up @@ -482,7 +480,6 @@ def upper_condition?(operator)

def create_all_match_data
data = ScanInfoData.new(0)
data.end = 0
data.flags = ScanInfo::Flags::PUSH
data.op = Operator::CALL
data.logical_op = Operator::OR
Expand Down
2 changes: 1 addition & 1 deletion lib/mrb/scripts/scan_info_data.rb
Expand Up @@ -17,7 +17,7 @@ class ScanInfoData
attr_accessor :weight
def initialize(start)
@start = start
@end = 0
@end = start
@op = Operator::NOP
@logical_op = Operator::OR
@query = nil
Expand Down

0 comments on commit e368cf6

Please sign in to comment.