我有以下 7 行代码,我怎样才能让它们更短更简洁?
max_group_size = 0
wrong_services.each do |service|
group_size = service.iep_service.group_size
if group_size > max_group_size then
max_group_size = group_size
end
end
我有以下 7 行代码,我怎样才能让它们更短更简洁?
max_group_size = 0
wrong_services.each do |service|
group_size = service.iep_service.group_size
if group_size > max_group_size then
max_group_size = group_size
end
end