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 21:58:32 UTC
[commons-bcel] branch master updated: Use Arrays.fill().
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-bcel.git
The following commit(s) were added to refs/heads/master by this push:
new 32f22dc Use Arrays.fill().
32f22dc is described below
commit 32f22dcc5aab94c0805931aab67365357335f222
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 20 16:58:27 2020 -0500
Use Arrays.fill().
---
src/main/java/org/apache/bcel/classfile/Utility.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/bcel/classfile/Utility.java b/src/main/java/org/apache/bcel/classfile/Utility.java
index c1bbb2d..094e3db 100644
--- a/src/main/java/org/apache/bcel/classfile/Utility.java
+++ b/src/main/java/org/apache/bcel/classfile/Utility.java
@@ -29,6 +29,7 @@ import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.zip.GZIPInputStream;
@@ -1352,9 +1353,7 @@ public abstract class Utility {
public static String fillup( final String str, final int length, final boolean left_justify, final char fill ) {
final int len = length - str.length();
final char[] buf = new char[(len < 0) ? 0 : len];
- for (int j = 0; j < buf.length; j++) {
- buf[j] = fill;
- }
+ Arrays.fill(buf, fill);
if (left_justify) {
return str + new String(buf);
}