Skip to content

Commit

Permalink
tap: revert caching Tap.reverse_tap_migrations_renames
Browse files Browse the repository at this point in the history
This could cause problems if a tap is installed during the lifetime
of the program which happens occasionally with `Tap#ensure_installed!`.

It also seems to be slow mainly because of intermediate arrays and
Pathname objects that get created in `Tap.each`. Maybe that should
be optimized instead.
  • Loading branch information
apainintheneck committed Mar 2, 2024
1 parent 4e65af0 commit fb055f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ def formula_reverse_renames

sig { returns(T::Hash[String, T::Array[String]]) }
def self.reverse_tap_migrations_renames
cache[:reverse_tap_migrations_renames] ||= Tap.each_with_object({}) do |tap, hash|
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
Expand Down

0 comments on commit fb055f7

Please sign in to comment.