From 2fedd5b09ad9b3a2b9f80a1cb8b3b2d13ff7b5f5 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 3 Aug 2014 10:47:47 -0500 Subject: [PATCH] Don't pass nil to fails_with? --- Library/Homebrew/compilers.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index c1e22f702e..34b7d69633 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