Skip to content
Snippets Groups Projects
Commit 3bb409d2 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Make the cases clear instead of having guards

parent 45afdbef
No related branches found
No related tags found
No related merge requests found
Loading
@@ -31,13 +31,13 @@ module Ci
Loading
@@ -31,13 +31,13 @@ module Ci
current_status = status_for_prior_stages(index) current_status = status_for_prior_stages(index)
   
created_builds_in_stage(index).select do |build| 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
end end
   
def process_build(build, current_status) 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) if valid_statuses_for_when(build.when).include?(current_status)
build.enqueue build.enqueue
true true
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment