mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/find.rb (Find.find): reduce stat system call.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
89214aac7a
commit
5e795ef8f6
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Sun Dec 6 23:16:35 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* lib/find.rb (Find.find): reduce stat system call.
|
||||||
|
|
||||||
Sun Dec 6 16:02:15 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
Sun Dec 6 16:02:15 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* lib/webrick/httpservlet/filehandler.rb: escape filename of index.
|
* lib/webrick/httpservlet/filehandler.rb: escape filename of index.
|
||||||
|
|
|
@ -39,9 +39,13 @@ module Find
|
||||||
while file = paths.shift
|
while file = paths.shift
|
||||||
catch(:prune) do
|
catch(:prune) do
|
||||||
yield file.dup.taint
|
yield file.dup.taint
|
||||||
next unless File.exist? file
|
begin
|
||||||
|
s = File.lstat(file)
|
||||||
|
rescue SystemCallError
|
||||||
|
next
|
||||||
|
end
|
||||||
begin
|
begin
|
||||||
if File.lstat(file).directory? then
|
if s.directory? then
|
||||||
d = Dir.open(file)
|
d = Dir.open(file)
|
||||||
begin
|
begin
|
||||||
for f in d
|
for f in d
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue