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
commit7178210a71be41eb56dd238b57a6e77c29cccbf6 (patch)
treea16635f0b2d2889478b48e90cc64b4f0dbb25257 /Library
parent45158034740e259b0cec619c25f34d528685b78e (diff)
downloadbrew-7178210a71be41eb56dd238b57a6e77c29cccbf6.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