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.
This commit is contained in:
parent
4e65af0391
commit
fb055f7aaf
@ -820,7 +820,7 @@ class Tap
|
|||||||
|
|
||||||
sig { returns(T::Hash[String, T::Array[String]]) }
|
sig { returns(T::Hash[String, T::Array[String]]) }
|
||||||
def self.reverse_tap_migrations_renames
|
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|
|
tap.tap_migrations.each do |old_name, new_name|
|
||||||
new_tap_user, new_tap_repo, new_name = new_name.split("/", 3)
|
new_tap_user, new_tap_repo, new_name = new_name.split("/", 3)
|
||||||
next unless new_name
|
next unless new_name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user