Commit 0a367278 authored by Cameron Swords's avatar Cameron Swords

Removed prematurely optimized memoization of small array

parent 9fac26f6
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
module Security module Security
class JobsFinder class JobsFinder
include Gitlab::Utils::StrongMemoize
attr_reader :pipeline attr_reader :pipeline
JOB_TYPES = [:sast, :dast, :dependency_scanning, :container_scanning].freeze JOB_TYPES = [:sast, :dast, :dependency_scanning, :container_scanning].freeze
...@@ -39,15 +37,9 @@ module Security ...@@ -39,15 +37,9 @@ module Security
private private
def job_types_for_processing def job_types_for_processing
strong_memoize(:job_types_for_processing) do return JOB_TYPES if @params[:all]
if @params[:all]
JOB_TYPES JOB_TYPES.select { |job_type| @params[job_type] }
else
JOB_TYPES.each_with_object([]) do |job_type, job_types|
job_types << job_type if @params[job_type]
end
end
end
end end
def find_jobs(job_types) def find_jobs(job_types)
......
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