From 85169635bd0a79458bec8c4f972bcd3629fa48cf Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 29 Sep 2018 20:42:14 +0200 Subject: [PATCH] Use arraycopy --- .../MousePadPlugin/PointerAccelerationProfileFactory.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/MousePadPlugin/PointerAccelerationProfileFactory.java b/src/org/kde/kdeconnect/Plugins/MousePadPlugin/PointerAccelerationProfileFactory.java index ad0b7b2d..2854e8ae 100644 --- a/src/org/kde/kdeconnect/Plugins/MousePadPlugin/PointerAccelerationProfileFactory.java +++ b/src/org/kde/kdeconnect/Plugins/MousePadPlugin/PointerAccelerationProfileFactory.java @@ -55,9 +55,7 @@ public class PointerAccelerationProfileFactory { /* add an event to the touchEventHistory array, shifting everything else in the array. */ private void addHistory(float deltaX, float deltaY, long eventTime) { - for (int i = touchEventHistory.length - 1; i > 0; i--) { - touchEventHistory[i] = touchEventHistory[i - 1]; - } + System.arraycopy(touchEventHistory, 0, touchEventHistory, 1, touchEventHistory.length - 1); touchEventHistory[0] = new TouchDeltaEvent(deltaX, deltaY, eventTime); }