From f6f1371149e3da645f63005acec548ad27bcf812 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 3 Aug 2014 10:47:47 -0500 Subject: Don't pass nil to fails_with? --- Library/Homebrew/compilers.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'Library/Homebrew') diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index c1e22f702..34b7d6963 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -116,15 +116,10 @@ class CompilerSelector # Attempts to select an appropriate alternate compiler, but # if none can be found raises CompilerError instead def compiler - begin - cc = @compilers.pop - end while @f.fails_with?(cc) - - if cc.nil? - raise CompilerSelectionError.new(@f) - else - cc.name + while cc = @compilers.pop + return cc.name unless @f.fails_with?(cc) end + raise CompilerSelectionError.new(@f) end private -- cgit v1.2.3