Skip to content

Commit 651829c

Browse files
committed
test-js: Use Core::File::is_directory(path) instead of opening file
1 parent 695ba07 commit 651829c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Userland/test-js.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,7 @@ void iterate_directory_recursively(const String& directory_path, Callback callba
160160

161161
while (directory_iterator.has_next()) {
162162
auto file_path = String::format("%s/%s", directory_path.characters(), directory_iterator.next_path().characters());
163-
auto file = Core::File::open(file_path, Core::IODevice::OpenMode::NotOpen);
164-
ASSERT(!file.is_error());
165-
166-
if (file.value()->is_directory()) {
163+
if (Core::File::is_directory(file_path)) {
167164
iterate_directory_recursively(file_path, callback);
168165
} else {
169166
callback(move(file_path));

0 commit comments

Comments
 (0)