Skip to content

Commit

Permalink
Update URL.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
LePips committed Apr 20, 2023
1 parent ae469d4 commit 565e9ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Shared/Extensions/URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ extension URL {
guard let urls = FileManager.default.enumerator(at: self, includingPropertiesForKeys: nil)?.allObjects as? [URL]
else { return nil }
return try urls.lazy.reduce(0) {
(try $1.resourceValues(forKeys: [.totalFileAllocatedSizeKey]).totalFileAllocatedSize ?? 0) + $0
try ($1.resourceValues(forKeys: [.totalFileAllocatedSizeKey]).totalFileAllocatedSize ?? 0) + $0
}
}

return try FileManager.default.contentsOfDirectory(at: self, includingPropertiesForKeys: nil).lazy.reduce(0) {
(
try $1.resourceValues(forKeys: [.totalFileAllocatedSizeKey])
try (
$1.resourceValues(forKeys: [.totalFileAllocatedSizeKey])
.totalFileAllocatedSize ?? 0
) + $0
}
Expand Down

0 comments on commit 565e9ec

Please sign in to comment.