On Thu, Nov 19, 2020 at 09:38:22AM +0800, Lu Kaiyi wrote:
[why] Avoid to execute some unnecessary operations and improve performance.
[how] Keep the value.size condition judgement to the front of block.
Signed-off-by: Lu Kaiyi 2392863668@qq.com
lib/matrix2.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/matrix2.rb b/lib/matrix2.rb index 62d174c..86cfc93 100644 --- a/lib/matrix2.rb +++ b/lib/matrix2.rb @@ -116,15 +116,15 @@ def combine_group_query_data(query_data, dims) job_list = query_data['hits']['hits'] groups = auto_group(job_list, dims) groups.each do |group_key, value|
- if value.size < 2
groups.delete(group_key)
Is this need to delete?
Thanks, Xueliang
next
- end suite_list = [] value.each do |dimension_key, jobs| groups[group_key][dimension_key], suites = create_matrix(jobs) suite_list.concat(suites) end
- if value.size < 2
groups.delete(group_key)
next
- end suites_list << suite_list end
-- 2.23.0