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-imaging.git

commit 3dccb2b59f5a0b2e5186c9f7bc6d8a35eb94e0ef
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Mon Nov 27 08:34:14 2023 -0500

    PMD: System.arraycopy is more efficient
---
 .../commons/imaging/formats/tiff/fieldtypes/FieldTypeLong8.java       | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong8.java
 
b/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong8.java
index a31098ff..e939e3db 100644
--- 
a/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong8.java
+++ 
b/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong8.java
@@ -62,9 +62,7 @@ public class FieldTypeLong8 extends AbstractFieldType {
         }
         final Integer[] numbers = (Integer[]) o;
         final int[] values = Allocator.intArray(numbers.length);
-        for (int i = 0; i < values.length; i++) {
-            values[i] = numbers[i];
-        }
+        System.arraycopy(numbers, 0, values, 0, values.length);
         return ByteConversions.toBytes(values, byteOrder);
     }
 

Reply via email to