mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
tap: memoize Tap.reverse_tap_migrations_renames
This should be a relatively small hash but it gets recalculated every time we call Cask#oldnames or Formula#oldnames which ends up being a lot if you run certain commands with --eval-all. For example, when running the following, it took 10% of the total runtime. ``` brew deps --casks --eval-all ```
This commit is contained in:
parent
99d5200db3
commit
2da1c93df7
@ -820,7 +820,7 @@ class Tap
|
||||
|
||||
sig { returns(T::Hash[String, T::Array[String]]) }
|
||||
def self.reverse_tap_migrations_renames
|
||||
Tap.each_with_object({}) do |tap, hash|
|
||||
cache[:reverse_tap_migrations_renames] ||= Tap.each_with_object({}) do |tap, hash|
|
||||
tap.tap_migrations.each do |old_name, new_name|
|
||||
new_tap_user, new_tap_repo, new_name = new_name.split("/", 3)
|
||||
next unless new_name
|
||||
|
Loading…
x
Reference in New Issue
Block a user