From 4e7cc28430793d3ebc726bb5b7db30a57ccd5d94 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 4 Feb 2013 15:00:10 -0600 Subject: MacOS: cache calls to mdfind --- Library/Homebrew/macos.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Library') 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 -- cgit v1.2.3