keg_relocate: replaced 'if' with guard clause

Closes Homebrew/homebrew#46211.
This commit is contained in:
Syed Humza Shah 2015-11-20 14:40:28 +00:00 committed by Mike McQuaid
parent 5607858d90
commit 5e09a6a743

View File

@ -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