diff --git a/lib/cask/source/tapped.rb b/lib/cask/source/tapped.rb index a36e51f6afe4e..e26472022ef94 100644 --- a/lib/cask/source/tapped.rb +++ b/lib/cask/source/tapped.rb @@ -4,6 +4,10 @@ def self.me?(query) end def self.path_for_query(query) + # Repeating Cask.all_titles is very slow for operations such as + # brew cask list, but memoizing the value might cause breakage + # elsewhere, given that installation and tap status is permitted + # to change during the course of an invocation. cask_with_tap = Cask.all_titles.find { |t| t.split('/').last == query.sub(/\.rb$/i,'') } if cask_with_tap user, repo, cask = cask_with_tap.split('/')