From 7a10493387a2e4fc921a6a12b1bd07d8166ebfac Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 14 Dec 2013 09:35:57 -0600 Subject: [PATCH] keg: try to avoid disk IO when possible Calling Pathname#text_executable? reads in the first 1024 bytes of the file, so try the basename check (which requires no filesystem access) first. --- Library/Homebrew/keg_fix_install_names.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb index 4e596a1f85..1eb2e5737b 100644 --- a/Library/Homebrew/keg_fix_install_names.rb +++ b/Library/Homebrew/keg_fix_install_names.rb @@ -181,7 +181,7 @@ class Keg # find name-config scripts, which can be all over the keg Pathname.new(self).find do |pn| next if pn.symlink? or pn.directory? - pkgconfig_files << pn if pn.text_executable? and pn.basename.to_s.end_with? '-config' + pkgconfig_files << pn if pn.basename.to_s.end_with? '-config' and pn.text_executable? end pkgconfig_files end