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