Skip to content

Commit

Permalink
doc/comment: known performance issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandwalker committed May 15, 2014
1 parent 3c40e82 commit 5b2e9d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/cask/source/tapped.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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('/')
Expand Down

0 comments on commit 5b2e9d1

Please sign in to comment.