Skip to content

Commit

Permalink
Set the variable to false instead of checking if it is defined
Browse files Browse the repository at this point in the history
We already have an initalize method, so we can just set the variable to
false there.
  • Loading branch information
rafaelfranca committed Aug 5, 2023
1 parent d1729d5 commit 5e3ca3b
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -9,6 +9,7 @@ def initialize(size:, with:, threshold: ActiveSupport.test_parallelization_thres
@size = size
@parallelize_with = with
@threshold = threshold
@parallelized = false
end

def start
Expand Down Expand Up @@ -49,7 +50,7 @@ def parallelize
end

def parallelized?
@parallelized if defined?(@parallelized)
@parallelized
end

def should_parallelize?
Expand Down

0 comments on commit 5e3ca3b

Please sign in to comment.