From 335d4abbe144d742e75abf230abb78cbb0857919 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 15 Oct 2020 22:44:13 -0700 Subject: [PATCH] Performance pass 3 (Manual array copy) --- src/main/java/com/volmit/iris/util/DoubleArrayUtils.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/com/volmit/iris/util/DoubleArrayUtils.java b/src/main/java/com/volmit/iris/util/DoubleArrayUtils.java index 016acee40..5dd99359e 100644 --- a/src/main/java/com/volmit/iris/util/DoubleArrayUtils.java +++ b/src/main/java/com/volmit/iris/util/DoubleArrayUtils.java @@ -5,10 +5,7 @@ public class DoubleArrayUtils { public static void shiftRight(double[] values, double push) { - for(int index = values.length - 2; index >= 0; index--) - { - values[index + 1] = values[index]; - } + if (values.length - 2 + 1 >= 0) System.arraycopy(values, 0, values, 1, values.length - 2 + 1); values[0] = push; }