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 2025/05/31 12:58:45 UTC
(commons-compress) 03/07: 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-compress.git
commit 7d410b100208c707ab9d1730570c5b88d20d0a80
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat May 31 08:22:53 2025 -0400
Use Arrays.fill()
---
.../java/org/apache/commons/compress/archivers/tar/TarUtils.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
index 0c325b3c6..4b53664f1 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
@@ -26,6 +26,7 @@
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -117,10 +118,7 @@ private static void formatBigIntegerBinary(final long value, final byte[] buf, f
}
final int off = offset + length - len;
System.arraycopy(b, 0, buf, off, len);
- final byte fill = (byte) (negative ? 0xff : 0);
- for (int i = offset + 1; i < off; i++) {
- buf[i] = fill;
- }
+ Arrays.fill(buf, offset + 1, off, (byte) (negative ? 0xff : 0));
}
/**