Merge pull request #13720 from FnControlOption/patch-1

Fix caching in Formula#runtime_installed_formula_dependents
This commit is contained in:
Mike McQuaid 2022-08-19 08:25:32 +01:00 committed by GitHub
commit 6eca55a60d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2003,7 +2003,7 @@ class Formula
# `any_installed_keg` and `runtime_dependencies` `select`s ensure
# that we don't end up with something `Formula#runtime_dependencies` can't
# read from a `Tab`.
Formula.cache[:runtime_installed_formula_dependents] = {}
Formula.cache[:runtime_installed_formula_dependents] ||= {}
Formula.cache[:runtime_installed_formula_dependents][full_name] ||= Formula.installed
.select(&:any_installed_keg)
.select(&:runtime_dependencies)