From 3bb409d2eeaa36921149984065b10e6d9394e641 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Mon, 12 Sep 2016 18:49:58 +0800 Subject: Make the cases clear instead of having guards --- app/services/ci/process_pipeline_service.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/services') diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb index de48a50774e..36c93dddadb 100644 --- a/app/services/ci/process_pipeline_service.rb +++ b/app/services/ci/process_pipeline_service.rb @@ -31,13 +31,13 @@ module Ci current_status = status_for_prior_stages(index) created_builds_in_stage(index).select do |build| - process_build(build, current_status) + if HasStatus::COMPLETED_STATUSES.include?(current_status) + process_build(build, current_status) + end end end def process_build(build, current_status) - return false unless HasStatus::COMPLETED_STATUSES.include?(current_status) - if valid_statuses_for_when(build.when).include?(current_status) build.enqueue true -- cgit v1.2.1