aboutsummaryrefslogtreecommitdiffhomepage
path: root/benchmark/bench_misc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/bench_misc.cpp')
-rw-r--r--benchmark/bench_misc.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/benchmark/bench_misc.cpp b/benchmark/bench_misc.cpp
index 18b68417f..1cbbbe170 100644
--- a/benchmark/bench_misc.cpp
+++ b/benchmark/bench_misc.cpp
@@ -228,13 +228,7 @@ class CreateFileBench final : public td::Benchmark {
}
}
void tear_down() final {
- td::walk_path("A/", [&](td::CSlice path, auto type) {
- if (type == td::WalkPath::Type::ExitDir) {
- td::rmdir(path).ignore();
- } else if (type == td::WalkPath::Type::NotDir) {
- td::unlink(path).ignore();
- }
- }).ignore();
+ td::rmrf("A/").ignore();
}
};
@@ -250,22 +244,10 @@ class WalkPathBench final : public td::Benchmark {
}
void run(int n) final {
int cnt = 0;
- td::walk_path("A/", [&](td::CSlice path, auto type) {
- if (type == td::WalkPath::Type::EnterDir) {
- return;
- }
- td::stat(path).ok();
- cnt++;
- }).ignore();
+ td::rmrf("A/").ignore();
}
void tear_down() final {
- td::walk_path("A/", [&](td::CSlice path, auto type) {
- if (type == td::WalkPath::Type::ExitDir) {
- td::rmdir(path).ignore();
- } else if (type == td::WalkPath::Type::NotDir) {
- td::unlink(path).ignore();
- }
- }).ignore();
+ td::rmrf("A/").ignore();
}
};