2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 13:47:41 +00:00

Use arraycopy

This commit is contained in:
Nicolas Fella
2018-09-29 20:42:14 +02:00
parent e68224f2b1
commit 85169635bd

View File

@@ -55,9 +55,7 @@ public class PointerAccelerationProfileFactory {
/* add an event to the touchEventHistory array, shifting everything else in the array. */ /* add an event to the touchEventHistory array, shifting everything else in the array. */
private void addHistory(float deltaX, float deltaY, long eventTime) { private void addHistory(float deltaX, float deltaY, long eventTime) {
for (int i = touchEventHistory.length - 1; i > 0; i--) { System.arraycopy(touchEventHistory, 0, touchEventHistory, 1, touchEventHistory.length - 1);
touchEventHistory[i] = touchEventHistory[i - 1];
}
touchEventHistory[0] = new TouchDeltaEvent(deltaX, deltaY, eventTime); touchEventHistory[0] = new TouchDeltaEvent(deltaX, deltaY, eventTime);
} }