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.
This commit is contained in:
parent
24d8791dfb
commit
7a10493387
@ -181,7 +181,7 @@ class Keg
|
|||||||
# find name-config scripts, which can be all over the keg
|
# find name-config scripts, which can be all over the keg
|
||||||
Pathname.new(self).find do |pn|
|
Pathname.new(self).find do |pn|
|
||||||
next if pn.symlink? or pn.directory?
|
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
|
end
|
||||||
pkgconfig_files
|
pkgconfig_files
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user