diff options
| author | Jack Nagel | 2013-05-15 12:45:36 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-05-15 12:56:58 -0500 |
| commit | 5515d359d5641ab0d9b11dc8ebfc9e495c013413 (patch) | |
| tree | 8f2fb3eb571be630aa5328bf7882ba706b4f38af /Library/Homebrew/cmd | |
| parent | 8cd331718e1fce7a4d8e672ba492e5fe95acfb9a (diff) | |
| download | brew-5515d359d5641ab0d9b11dc8ebfc9e495c013413.tar.bz2 | |
cleanup: use early return rather than method-spanning conditional
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/cleanup.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index 8e57b7341..6a83d3e78 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 |
