Refactor code to create less objects

This commit is contained in:
Dan Kubb 2013-08-05 00:15:40 -07:00
parent 648bfd5e66
commit 952cf9fcd5

View file

@ -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