From 651829c1e615fa87e51538abe75b826b047ad238 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 6 Jul 2020 23:46:04 +0200 Subject: [PATCH] test-js: Use Core::File::is_directory(path) instead of opening file --- Userland/test-js.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Userland/test-js.cpp b/Userland/test-js.cpp index 2546c2aa03..8be43022fb 100644 --- a/Userland/test-js.cpp +++ b/Userland/test-js.cpp @@ -160,10 +160,7 @@ void iterate_directory_recursively(const String& directory_path, Callback callba while (directory_iterator.has_next()) { auto file_path = String::format("%s/%s", directory_path.characters(), directory_iterator.next_path().characters()); - auto file = Core::File::open(file_path, Core::IODevice::OpenMode::NotOpen); - ASSERT(!file.is_error()); - - if (file.value()->is_directory()) { + if (Core::File::is_directory(file_path)) { iterate_directory_recursively(file_path, callback); } else { callback(move(file_path));