You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/01/07 03:19:42 UTC

[commons-io] branch master updated: Simplify.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new c644915  Simplify.
c644915 is described below

commit c644915d4161fef3f238046991e3f1490c7c2f64
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Jan 6 22:19:37 2021 -0500

    Simplify.
---
 src/main/java/org/apache/commons/io/file/PathUtils.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/file/PathUtils.java b/src/main/java/org/apache/commons/io/file/PathUtils.java
index c850d81..7bfab16 100644
--- a/src/main/java/org/apache/commons/io/file/PathUtils.java
+++ b/src/main/java/org/apache/commons/io/file/PathUtils.java
@@ -740,11 +740,8 @@ public final class PathUtils {
      */
     public static boolean isEmptyDirectory(final Path directory) throws IOException {
         try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(directory)) {
-            if (directoryStream.iterator().hasNext()) {
-                return false;
-            }
+            return !directoryStream.iterator().hasNext();
         }
-        return true;
     }
 
     /**