diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-09-06 18:12:46 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-09-06 18:12:46 +0800 |
commit | b92c75ab982e123e2e1efc189e35b84c0ffd1c27 (patch) | |
tree | 9e2c1ae9dc7f8be9e0b8861beb0613ba47efe4ee | |
parent | 413516081b91f3e64305fa3f4dffd84a564596a7 (diff) | |
download | gitlab-ce-b92c75ab982e123e2e1efc189e35b84c0ffd1c27.tar.gz |
Use sum, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14991392
-rw-r--r-- | lib/gitlab/ci/pipeline_duration.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/gitlab/ci/pipeline_duration.rb b/lib/gitlab/ci/pipeline_duration.rb index cd782934302..9fe4996fc09 100644 --- a/lib/gitlab/ci/pipeline_duration.rb +++ b/lib/gitlab/ci/pipeline_duration.rb @@ -133,9 +133,7 @@ module Gitlab end def process_duration(periods) - periods.inject(0) do |result, per| - result + per.duration - end + periods.sum(&:duration) end end end |