YUKI Hiroshi
null+****@clear*****
Fri Jan 24 18:04:18 JST 2014
YUKI Hiroshi 2014-01-24 18:04:18 +0900 (Fri, 24 Jan 2014) New Revision: 963f27cc16e61b5723f29c232616703278b4683f https://github.com/droonga/fluent-plugin-droonga/commit/963f27cc16e61b5723f29c232616703278b4683f Message: Merge Groonga result header correctly Modified files: lib/droonga/plugin/collector/groonga.rb Modified: lib/droonga/plugin/collector/groonga.rb (+4 -10) =================================================================== --- lib/droonga/plugin/collector/groonga.rb 2014-01-24 18:02:03 +0900 (a7ca5a3) +++ lib/droonga/plugin/collector/groonga.rb 2014-01-24 18:04:18 +0900 (8ca33f9) @@ -47,12 +47,10 @@ module Droonga def merge_groonga_result(left_value, right_value) result = [] - result << merge_groonga_header(left_value.first, right_value.first) + result << merge_groonga_header(left_value.shift, right_value.shift) - left_body = left_value[1..-1] - right_body = right_value[1..-1] - left_body.each_with_index do |left, index| - right = right_body[index] + left_value.each_with_index do |left, index| + right = right_value[index] result << reduce({ "type" => "and" }, left, right) end @@ -60,16 +58,12 @@ module Droonga end def merge_groonga_header(left_header, right_header) - left_status = left_header.shift - right_status = right_header.shift - status = [left_status, right_status].min + status = [left_header.shift, right_header.shift].min start_time = reduce({ "type" => "average" }, left_header.shift, right_header.shift) - left_elapsed_time = left_header.shift - right_elapsed_time = right_header.shift elapsed_time = reduce({ "type" => "average" }, left_header.shift, right_header.shift) -------------- next part -------------- HTML����������������������������... Download