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 765e3e45ec667584fb18ee12bd2995d1d9e6bd97
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat May 31 08:37:30 2025 -0400

    Use Arrays.fill()
---
 src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java | 4 +---
 1 file changed, 1 insertion(+), 3 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 4b53664f1..c1b0727ce 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
@@ -253,9 +253,7 @@ public static int formatNameBytes(final String name, final 
byte[] buf, final int
         final int limit = b.limit() - b.position();
         System.arraycopy(b.array(), b.arrayOffset(), buf, offset, limit);
         // Pad any remaining output bytes with NUL
-        for (int i = limit; i < length; ++i) {
-            buf[offset + i] = 0;
-        }
+        Arrays.fill(buf, offset + limit, offset + length, (byte) 0);
         return offset + length;
     }
 

Reply via email to