From deb65a959d6b1a8434b0304f6389a6e8065d1e25 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 13 May 2014 12:13:05 -0500 Subject: [PATCH] Use a case statement --- Library/Homebrew/extend/ENV/super.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index f35fa1ff3d..699ac6f4be 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -133,16 +133,14 @@ module Superenv # Homebrew's apple-gcc42 will be outside the PATH in superenv, # so xcrun may not be able to find it - if self['HOMEBREW_CC'] == 'gcc-4.2' - apple_gcc42 = begin - Formulary.factory('apple-gcc42') + case self["HOMEBREW_CC"] + when "gcc-4.2" + begin + apple_gcc42 = Formulary.factory('apple-gcc42') rescue Exception # in --debug, catch bare exceptions too - nil end paths << apple_gcc42.opt_bin.to_s if apple_gcc42 - end - - if self['HOMEBREW_CC'] =~ GNU_GCC_REGEXP + when GNU_GCC_REGEXP gcc_formula = gcc_version_formula($1) paths << gcc_formula.opt_bin.to_s end