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 2023/11/27 13:37:39 UTC

(commons-imaging) 11/11: PMD: System.arraycopy is more efficient

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 bc64d713f32dd76fbe96d11d14e33949c17e7563
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Nov 27 08:34:19 2023 -0500

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

diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java b/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java
index 1b520078..37811091 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java
@@ -52,9 +52,7 @@ public class FieldTypeLong 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);
     }