Skip to content

Commit c644915

Browse files
author
Gary Gregory
committed
Simplify.
1 parent d5bb4ec commit c644915

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/main/java/org/apache/commons/io/file/PathUtils.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,11 +740,8 @@ public static boolean isEmpty(final Path path) throws IOException {
740740
*/
741741
public static boolean isEmptyDirectory(final Path directory) throws IOException {
742742
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(directory)) {
743-
if (directoryStream.iterator().hasNext()) {
744-
return false;
745-
}
743+
return !directoryStream.iterator().hasNext();
746744
}
747-
return true;
748745
}
749746

750747
/**

0 commit comments

Comments
 (0)