Skip to content
Snippets Groups Projects
Commit 0581dda1 authored by Markus Reiter's avatar Markus Reiter
Browse files

Auto-correct guard clauses.

parent 14362a7e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment