aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2013-05-15 12:45:36 -0500
committerJack Nagel2013-05-15 12:56:58 -0500
commit5515d359d5641ab0d9b11dc8ebfc9e495c013413 (patch)
tree8f2fb3eb571be630aa5328bf7882ba706b4f38af /Library/Homebrew/cmd
parent8cd331718e1fce7a4d8e672ba492e5fe95acfb9a (diff)
downloadbrew-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.rb14
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