Navigation Menu

Skip to content

Commit

Permalink
response-comparer: share more common codes
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 13, 2018
1 parent 3974d85 commit 5bd74c4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/groonga-query-log/response-comparer.rb
Expand Up @@ -209,15 +209,15 @@ def same_records_all_output_columns?
end

def same_records?
records_result1 = @response1.body[0] || []
records_result2 = @response2.body[0] || []
return false if records_result1.size != records_result2.size

same_record_set?(records_result1,
records_result2)
record_set1 = @response1.body[0] || []
record_set2 = @response2.body[0] || []
same_record_set?(record_set1,
record_set2)
end

def same_record_set?(record_set1, record_set2)
return false if record_set1.size != record_set2.size

n_hits1 = record_set1[0]
n_hits2 = record_set2[0]
return false if n_hits1 != n_hits2
Expand Down

0 comments on commit 5bd74c4

Please sign in to comment.