diff options
| author | Syed Humza Shah | 2015-11-20 14:40:28 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2015-11-24 10:48:28 +0000 |
| commit | 5e09a6a7436f5a5a44332fbb5c957c83ce9a3bac (patch) | |
| tree | c7c1fc1c5f7aa33ee78918a465b30034b5c36116 /Library | |
| parent | 5607858d90f5475bf497213e8452a8f121da63ea (diff) | |
| download | brew-5e09a6a7436f5a5a44332fbb5c957c83ce9a3bac.tar.bz2 | |
keg_relocate: replaced 'if' with guard clause
Closes Homebrew/homebrew#46211.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/keg_relocate.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 0490b05c6..28eb5ef0f 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -56,6 +56,8 @@ class Keg changed = s.gsub!(old_cellar, new_cellar) changed = s.gsub!(old_prefix, new_prefix) || changed + next unless changed + begin first.atomic_write(s) rescue SystemCallError @@ -64,7 +66,7 @@ class Keg end else rest.each { |file| FileUtils.ln(first, file, :force => true) } - end if changed + end end end |
