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/07/01 18:16:53 UTC

[commons-io] branch master updated: Use lambdas.

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 fae4dd3  Use lambdas.
fae4dd3 is described below

commit fae4dd30857c309be2153e146703e9d910456b1e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Jul 1 14:16:49 2021 -0400

    Use lambdas.
---
 src/main/java/org/apache/commons/io/file/PathUtils.java | 7 +------
 1 file changed, 1 insertion(+), 6 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 29a19a5..6be1f85 100644
--- a/src/main/java/org/apache/commons/io/file/PathUtils.java
+++ b/src/main/java/org/apache/commons/io/file/PathUtils.java
@@ -841,12 +841,7 @@ public final class PathUtils {
         if (deleteOptions == null) {
             return false;
         }
-        for (final DeleteOption deleteOption : deleteOptions) {
-            if (deleteOption == StandardDeleteOption.OVERRIDE_READ_ONLY) {
-                return true;
-            }
-        }
-        return false;
+        return Stream.of(deleteOptions).anyMatch(e -> e == StandardDeleteOption.OVERRIDE_READ_ONLY);
     }
 
     /**