Refactor code to create less objects
This commit is contained in:
parent
648bfd5e66
commit
952cf9fcd5
1 changed files with 2 additions and 5 deletions
|
@ -63,12 +63,9 @@ module Mutant
|
|||
# @api private
|
||||
#
|
||||
def self.build(*arguments)
|
||||
classifiers = REGISTRY.map do |descendant|
|
||||
descendant.run(*arguments)
|
||||
end.compact
|
||||
|
||||
classifiers = REGISTRY.map { |descendant| descendant.run(*arguments) }
|
||||
classifiers.compact!
|
||||
raise if classifiers.length > 1
|
||||
|
||||
classifiers.first
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue