提交 d2cfcb3e 编写于 作者: L Lin Jen-Shin
上级 1e49a8bc
......@@ -132,18 +132,16 @@ module Gitlab
end
def process_periods(periods)
if periods.empty?
periods
else
periods.drop(1).inject([periods.first]) do |result, current|
merged = try_merge_period(result.last, current)
return periods if periods.empty?
if merged
result[-1] = merged
result
else
result << current
end
periods.drop(1).inject([periods.first]) do |result, current|
merged = try_merge_period(result.last, current)
if merged
result[-1] = merged
result
else
result << current
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册