Skip to content
Browse files

Replace custom collection with Set

The original constraints that led to using a custom collection rather
than Array or Set here no longer exist, so let's avoid the pointless
abstraction here.
  • Loading branch information...
1 parent b6d9c34 commit f91df69127967889a5e7ee7ac6decc6842b7b1cc @jacknagel jacknagel committed
Showing with 2 additions and 29 deletions.
  1. +0 −23 Library/Homebrew/compilers.rb
  2. +2 −6 Library/Homebrew/formula.rb
View
23 Library/Homebrew/compilers.rb
@@ -21,29 +21,6 @@ def <<(o)
end
-class CompilerFailures
- include Enumerable
-
- def initialize(*args)
- @failures = Array.new(*args)
- end
-
- def each(*args, &block)
- @failures.each(*args, &block)
- end
-
- def include?(cc)
- cc = Compiler.new(cc) unless cc.is_a? Compiler
- @failures.any? { |failure| failure.compiler == cc.name }
- end
-
- def <<(o)
- @failures << o unless include? o.compiler
- self
- end
-end
-
-
class Compiler
attr_reader :name, :build
View
8 Library/Homebrew/formula.rb
@@ -785,12 +785,8 @@ def keg_only reason, explanation=nil
end
def fails_with compiler, &block
- @cc_failures ||= CompilerFailures.new
- @cc_failures << if block_given?
- CompilerFailure.new(compiler, &block)
- else
- CompilerFailure.new(compiler)
- end
+ @cc_failures ||= Set.new
+ @cc_failures << CompilerFailure.new(compiler, &block)
end
def test &block

4 comments on commit f91df69

@adamv

This may have broken versions?

@mikemcquaid
Homebrew member

@adamv I think we should change versions to say to checkout core too. It's just too buggy otherwise.

@adamv

Let's move Erlang 15 to homebrew-versions

@jacknagel

Fixed in 6f6c889

Please sign in to comment.
Something went wrong with that request. Please try again.