aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-02-04 15:00:10 -0600
committerJack Nagel2013-02-06 22:24:24 -0600
commit4e7cc28430793d3ebc726bb5b7db30a57ccd5d94 (patch)
treea20585207dc6a44992886f7907abacd0ca321375 /Library
parenta09dcb96459f84f9b9a62cb0ed77b107454b734a (diff)
downloadhomebrew-4e7cc28430793d3ebc726bb5b7db30a57ccd5d94.tar.bz2
MacOS: cache calls to mdfind
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/macos.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb
index 3d7defa6f..05faa0412 100644
--- a/Library/Homebrew/macos.rb
+++ b/Library/Homebrew/macos.rb
@@ -230,7 +230,9 @@ module MacOS extend self
end
def mdfind id
- `/usr/bin/mdfind "kMDItemCFBundleIdentifier == '#{id}'"`.split("\n")
+ (@mdfind ||= {}).fetch(id.to_s) do
+ @mdfind[id.to_s] = `/usr/bin/mdfind "kMDItemCFBundleIdentifier == '#{id}'"`.split("\n")
+ end
end
def pkgutil_info id