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 2020/11/20 20:09:56 UTC

[commons-vfs] branch master updated: Add elements of a collections without 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-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new f5e1cbd  Add elements of a collections without a loop.
f5e1cbd is described below

commit f5e1cbd129845b794163be9d50eedc1372a8f52c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 20 15:09:52 2020 -0500

    Add elements of a collections without a loop.
---
 commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java
index db2d6bc..95768fc 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java
@@ -18,6 +18,7 @@ package org.apache.commons.vfs2.util;
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
@@ -242,9 +243,7 @@ public final class Os {
                 final OsFamily family = queue.remove(0);
                 allFamilies.add(family);
                 final OsFamily[] families = family.getFamilies();
-                for (final OsFamily parent : families) {
-                    queue.add(parent);
-                }
+                Collections.addAll(queue, families);
             }
         }
         return allFamilies.toArray(new OsFamily[allFamilies.size()]);