aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-10-08 20:03:40 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-10-08 20:03:40 -0700
commitcd4397783f7ae86de867bed3346ea10547a94ee1 (patch)
tree4ce6a807c43bacfabee5312517ca6f35b118ad2d /test
parent4a2cf388440f6efadf9c7664b63c3949b25d6824 (diff)
downloadzig-cd4397783f7ae86de867bed3346ea10547a94ee1.tar.gz
zig-cd4397783f7ae86de867bed3346ea10547a94ee1.zip
Package.Fetch: improved deletion algorithm
Instead of every file deletion being followed by a recursive attempt to remove the parent directory, while walking the directory, every directory that will have nonzero files deleted from it is tracked in an array hash map. After all the threads have finished deleting and hashing, the parent thread sorts the "suspicious" directories by length, descending, ensuring that children appear before parents, and then iterates over the array hash map, attempting a rmdir operation on each. Any rmdir that succeeds appends the parent directory to the map so that it will be removed if empty.
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions