From 62d1636144d40b7f80f36887bb25bf43f7d42981 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Thu, 20 Aug 2015 20:12:02 +0800 Subject: [PATCH] update: only update renamed when necessary --- Library/Homebrew/cmd/update.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index 398aca6f5e..d9cecf5d54 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -318,7 +318,7 @@ class Report end def update_renamed - @hash[:R] ||= [] + renamed_formulae = [] fetch(:D, []).each do |path| case path.to_s @@ -333,12 +333,15 @@ class Report end if fetch(:A, []).include?(newpath = path.dirname.join("#{newname}.rb")) - @hash[:R] << [path, newpath] + renamed_formulae << [path, newpath] end end - @hash[:A] -= @hash[:R].map(&:last) if @hash[:A] - @hash[:D] -= @hash[:R].map(&:first) if @hash[:D] + unless renamed_formulae.empty? + @hash[:A] -= renamed_formulae.map(&:last) if @hash[:A] + @hash[:D] -= renamed_formulae.map(&:first) if @hash[:D] + @hash[:R] = renamed_formulae + end end def select_formula(key)