From 9e8acb6312855af4b511e49ca6ddd24cb3454540 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 23 Feb 2024 15:07:42 +0100 Subject: [PATCH 1/3] Actually cache `Tap#audit_exceptions`. --- 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 c3fbc5f733da8..48884a6e0fe3a 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -851,7 +851,7 @@ def tap_migrations # Hash with audit exceptions sig { returns(Hash) } def audit_exceptions - @audit_exceptions = read_formula_list_directory "#{HOMEBREW_TAP_AUDIT_EXCEPTIONS_DIR}/*" + @audit_exceptions ||= read_formula_list_directory("#{HOMEBREW_TAP_AUDIT_EXCEPTIONS_DIR}/*") end # Hash with style exceptions From 34af31a05da109aff51463e29f65b4c2469f0b7a Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 23 Feb 2024 15:07:59 +0100 Subject: [PATCH 2/3] Actually cache `Tap#style_exceptions`. --- 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 48884a6e0fe3a..dbe5b15b96913 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -857,7 +857,7 @@ def audit_exceptions # Hash with style exceptions sig { returns(Hash) } def style_exceptions - @style_exceptions = read_formula_list_directory "#{HOMEBREW_TAP_STYLE_EXCEPTIONS_DIR}/*" + @style_exceptions ||= read_formula_list_directory("#{HOMEBREW_TAP_STYLE_EXCEPTIONS_DIR}/*") end # Hash with pypi formula mappings From 1a13097a866e4e2cffd4ea6e11dbe072659fb6d2 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 23 Feb 2024 15:08:11 +0100 Subject: [PATCH 3/3] Actually cache `Tap#pypi_formula_mappings`. --- Library/Homebrew/tap.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index dbe5b15b96913..a488bd35586d2 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -861,8 +861,9 @@ def style_exceptions end # Hash with pypi formula mappings + sig { returns(Hash) } def pypi_formula_mappings - @pypi_formula_mappings = read_formula_list path/HOMEBREW_TAP_PYPI_FORMULA_MAPPINGS_FILE + @pypi_formula_mappings ||= read_formula_list(path/HOMEBREW_TAP_PYPI_FORMULA_MAPPINGS_FILE) end # Array with synced versions formulae