Skip to content

Commit

Permalink
Merge pull request #16008 from Bo98/declared_runtime_dependencies-perf
Browse files Browse the repository at this point in the history
formula: add global caching for `declared_runtime_dependencies`
  • Loading branch information
MikeMcQuaid authored Sep 15, 2023
2 parents b2cf50b + be2834a commit 184efd9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,8 @@ def setup_home(home)
# 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?

Expand Down

0 comments on commit 184efd9

Please sign in to comment.