0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00

fs: Optimize Dir.deleteTree for non-deeply-nested directories

`deleteTree` now uses a stack-allocated stack for the first 16 nested directories, and then falls back to the previous implementation (which only keeps 1 directory open at a time) when it runs out of room in its stack. This allows the function to perform as well as a recursive implementation for most use-cases without needing allocation or introducing the possibility of stack overflow.
This commit is contained in:
Ryan Liptak 2022-10-05 03:17:52 -07:00
commit 274d19575e