mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 13:47:41 +00:00
Use arraycopy
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user