From fb055f7aaf12b5469bd41aa8a286334ada5523dc Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Sat, 2 Mar 2024 11:31:04 -0800 Subject: [PATCH] tap: revert caching `Tap.reverse_tap_migrations_renames` 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. --- Library/Homebrew/tap.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index b6e0c1d2ad5d0..fed9a01d946c9 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -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