aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-20 20:50:29 +0200
committerMarkus Reiter2016-09-23 15:30:05 +0200
commit0581dda187934933128a578400205557d9b27adc (patch)
tree0a88b499710931bcf179ab928041d52db283b5dc /Library
parent14362a7e5fe34be9a26eebda7424858c1458e0b2 (diff)
downloadbrew-0581dda187934933128a578400205557d9b27adc.tar.bz2
Auto-correct guard clauses.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/descriptions.rb4
-rw-r--r--Library/Homebrew/diagnostic.rb8
2 files changed, 3 insertions, 9 deletions
diff --git a/Library/Homebrew/descriptions.rb b/Library/Homebrew/descriptions.rb
index 5e7a5b06c..24e342474 100644
--- a/Library/Homebrew/descriptions.rb
+++ b/Library/Homebrew/descriptions.rb
@@ -12,9 +12,7 @@ class Descriptions
# If the cache file exists, load it into, and return, a hash; otherwise,
# return nil.
def self.load_cache
- if CACHE_FILE.exist?
- @cache = Utils::JSON.load(CACHE_FILE.read)
- end
+ @cache = Utils::JSON.load(CACHE_FILE.read) if CACHE_FILE.exist?
end
# Write the cache to disk after ensuring the existence of the containing
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index 650ff3eab..ae5a64c1d 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -39,15 +39,11 @@ module Homebrew
vols = get_mounts path
# no volume found
- if vols.empty?
- return -1
- end
+ return -1 if vols.empty?
vol_index = @volumes.index(vols[0])
# volume not found in volume list
- if vol_index.nil?
- return -1
- end
+ return -1 if vol_index.nil?
vol_index
end