From 5b2e9d1466134e300b6b1b12c5e1ceece6ca28f2 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Thu, 15 May 2014 16:52:41 -0400 Subject: [PATCH] doc/comment: known performance issues --- lib/cask/source/tapped.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cask/source/tapped.rb b/lib/cask/source/tapped.rb index a36e51f6afe4..e26472022ef9 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('/')