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-net.git
The following commit(s) were added to refs/heads/master by this push:
new ef9ccad Add elements to a list directly.
ef9ccad is described below
commit ef9ccad4fd281d6af41282a7e7e06c91e12e0caa
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Nov 20 15:30:04 2020 -0500
Add elements to a list directly.
---
src/main/java/org/apache/commons/net/nntp/Article.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/net/nntp/Article.java
b/src/main/java/org/apache/commons/net/nntp/Article.java
index 1e8a058..4c51fba 100644
--- a/src/main/java/org/apache/commons/net/nntp/Article.java
+++ b/src/main/java/org/apache/commons/net/nntp/Article.java
@@ -19,6 +19,7 @@ package org.apache.commons.net.nntp;
import java.io.PrintStream;
import java.util.ArrayList;
+import java.util.Collections;
/**
* This is a class that contains the basic state needed for message retrieval
and threading.
@@ -52,9 +53,7 @@ public class Article implements Threadable {
references = new ArrayList<>();
}
isReply = true;
- for(final String s : msgId.split(" ")) {
- references.add(s);
- }
+ Collections.addAll(references, msgId.split(" "));
}
/**