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