From 5515d359d5641ab0d9b11dc8ebfc9e495c013413 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 15 May 2013 12:45:36 -0500 Subject: [PATCH] cleanup: use early return rather than method-spanning conditional --- Library/Homebrew/cmd/cleanup.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index 8e57b7341b..6a83d3e78b 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -14,13 +14,13 @@ module Homebrew extend self end def cleanup_all - if HOMEBREW_CELLAR.directory? - HOMEBREW_CELLAR.children.each do |rack| - begin - cleanup_formula Formula.factory(rack.basename.to_s) if rack.directory? - rescue FormulaUnavailableError - # Don't complain about directories from DIY installs - end + return unless HOMEBREW_CELLAR.directory? + + HOMEBREW_CELLAR.children.each do |rack| + begin + cleanup_formula Formula.factory(rack.basename.to_s) if rack.directory? + rescue FormulaUnavailableError + # Don't complain about directories from DIY installs end end clean_cache