Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FilePath.walk performance issues (issue #2158). #2634

Merged
merged 1 commit into from
Apr 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions packages/files/file_path.pony
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,16 @@ class val FilePath
expanded by removing them from the `dir_entries` list.
"""
try
var entries: Array[String] ref = Directory(this)?.entries()?
handler(this, entries)
for e in entries.values() do
let p = this.join(e)?
if not follow_links and FileInfo(p)?.symlink then
continue
with dir = Directory(this)? do
var entries: Array[String] ref = dir.entries()?
handler(this, entries)
for e in entries.values() do
let p = this.join(e)?
let info = FileInfo(p)?
if info.directory and (follow_links or not info.symlink) then
p.walk(handler, follow_links)
end
end
p.walk(handler, follow_links)
end
else
return
Expand Down