Merge pull request #16008 from Bo98/declared_runtime_dependencies-perf

formula: add global caching for `declared_runtime_dependencies`
This commit is contained in:
Mike McQuaid 2023-09-15 08:26:45 +01:00 committed by GitHub
commit 184efd9eab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2579,7 +2579,8 @@ class Formula
# Returns a list of Dependency objects that are declared in the formula.
# @private
def declared_runtime_dependencies
recursive_dependencies do |_, dependency|
cache_key = "Formula#declared_runtime_dependencies" unless build.any_args_or_options?
Dependency.expand(self, cache_key: cache_key) do |_, dependency|
Dependency.prune if dependency.build?
next if dependency.required?