diff options
| author | Jack Nagel | 2013-03-13 02:07:01 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-03-16 13:05:02 -0500 |
| commit | f8b4959742393499dda5bb48fd55ba107433b381 (patch) | |
| tree | b97ebf2719aea3211b4cedd800a39331a713ce59 /Library/Homebrew/formula.rb | |
| parent | 7104e20bde71a72a99497c8148ebeb10cf97dfde (diff) | |
| download | brew-f8b4959742393499dda5bb48fd55ba107433b381.tar.bz2 | |
Use a priority queue to select compilers
The existing case-statement with nested if-statements is gross and hard
to extend. Replacing it with a priority queue simplifies the logic and
makes it very easy to add new compilers to the fails_with system, which
we will likely want to do in the future.
Diffstat (limited to 'Library/Homebrew/formula.rb')
| -rw-r--r-- | Library/Homebrew/formula.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 7ba0cd01e..77b1fabdb 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -198,9 +198,8 @@ class Formula end def fails_with? cc - return false if self.class.cc_failures.nil? cc = Compiler.new(cc) unless cc.is_a? Compiler - self.class.cc_failures.find do |failure| + (self.class.cc_failures || []).any? do |failure| failure.compiler == cc.name && failure.build >= cc.build end end |
