diff options
| author | Jack Nagel | 2013-05-15 12:45:36 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2013-05-15 12:56:58 -0500 | 
| commit | bceb8c57c838e7d20a5787cd71618cf407894bea (patch) | |
| tree | bd54e3208999d9e604d49856b18420868344af89 /Library/Homebrew/cmd/cleanup.rb | |
| parent | 717de9c6a7750227a6b9576764a9a90ec5a20311 (diff) | |
| download | homebrew-bceb8c57c838e7d20a5787cd71618cf407894bea.tar.bz2 | |
cleanup: use early return rather than method-spanning conditional
Diffstat (limited to 'Library/Homebrew/cmd/cleanup.rb')
| -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 | 
