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 2019/08/23 02:50:10 UTC

[commons-lang] branch master updated: Use a stream instead of a loop.

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-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new ea123dd  Use a stream instead of a loop.
     new 5f2bf30  Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-lang.git
ea123dd is described below

commit ea123dd82e67b443a761165a22cfce606e604a14
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Aug 22 22:49:41 2019 -0400

    Use a stream instead of a loop.
---
 src/main/java/org/apache/commons/lang3/ArchUtils.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/ArchUtils.java b/src/main/java/org/apache/commons/lang3/ArchUtils.java
index 4b0d3ff..7f36b28 100644
--- a/src/main/java/org/apache/commons/lang3/ArchUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ArchUtils.java
@@ -20,6 +20,7 @@ import org.apache.commons.lang3.arch.Processor;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.stream.Stream;
 
 /**
  * An utility class for the os.arch System Property. The class defines methods for
@@ -100,9 +101,7 @@ public class ArchUtils {
      * @throws IllegalStateException If the key already exists.
      */
     private static void addProcessors(final Processor processor, final String... keys) {
-        for (final String key : keys) {
-            addProcessor(key, processor);
-        }
+        Stream.of(keys).forEach(e -> addProcessor(e, processor));
     }
 
     /**