Commit d2cfcb3e authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment