`isDirectory(at:)` discards prefetched resource values
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start at the import loop that calls isDirectory(at:) after contentsOfDirectory(at:includingPropertiesForKeys:) prefetched .isDirectoryKey and .contentTypeKey. Compare it with url.contentType and read the resource value from each URL instead of making a fresh fileExists(atPath:isDirectory:) syscall. Done means the cached directory value is used for each URL while the import behavior remains unchanged.
Written by the indexing model from the issue text.
Description
contentsOfDirectory(at:includingPropertiesForKeys:) is called with [.contentTypeKey, .isDirectoryKey] — precisely so those values are cached on the returned URLs. But isDirectory(at:) calls fileExists(atPath:isDirectory:), a fresh syscall that ignores the cache, once per URL in the import loop.
Reading url.resourceValues(forKeys: [.isDirectoryKey]).isDirectory would use the prefetched value. (url.contentType already does the right thing.)
- Dominant language
- Swift
- Stars
- 0
- Forks
- 3
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BlueHuskyStudios/DeadassSimpleMediaPlayer
-
Better readme Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Automatically found
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Automatically found
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Automatically found bug good first issue
Difficulty 1/5 Under an hour Newbie friendliness 72/100
BlueHuskyStudios/DeadassSimpleMediaPlayer#44 · 1 comment ·
-
Automatically found
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in BlueHuskyStudios/DeadassSimpleMediaPlayer
Similar issues
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ionic-team/capacitor#8616 ·