keg_relocate: replaced 'if' with guard clause
Closes Homebrew/homebrew#46211.
This commit is contained in:
parent
5607858d90
commit
5e09a6a743
@ -56,6 +56,8 @@ class Keg
|
|||||||
changed = s.gsub!(old_cellar, new_cellar)
|
changed = s.gsub!(old_cellar, new_cellar)
|
||||||
changed = s.gsub!(old_prefix, new_prefix) || changed
|
changed = s.gsub!(old_prefix, new_prefix) || changed
|
||||||
|
|
||||||
|
next unless changed
|
||||||
|
|
||||||
begin
|
begin
|
||||||
first.atomic_write(s)
|
first.atomic_write(s)
|
||||||
rescue SystemCallError
|
rescue SystemCallError
|
||||||
@ -64,7 +66,7 @@ class Keg
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
rest.each { |file| FileUtils.ln(first, file, :force => true) }
|
rest.each { |file| FileUtils.ln(first, file, :force => true) }
|
||||||
end if changed
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user