commit b2814cd779dd321ae75538f3403a0c47a381ee15
parent 3a50491b8544eaf03cba05f691f37f8ab98fd449
Author: Drew DeVault <sir@cmpwn.com>
Date: Sat, 8 Jan 2022 15:45:40 +0100
fs::rmdirall: add perf comment
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/fs.ha b/fs/fs.ha
@@ -229,6 +229,8 @@ export fn rmdirall(fs: *fs, path: str) (void | error) = {
if (ent.name == "." || ent.name == "..") {
continue;
};
+ // XXX: This could probably be more efficient if we
+ // re-used the buffer further down the call stack.
let buf = alloc(path::init());
defer free(buf);
const path = path::set(buf, path, ent.name)!;