Remove use of Arrays.copyOf

The function has been added in API 9.
This commit is contained in:
Jules Aguillon 2023-07-05 18:58:03 +02:00
parent ef4477d50c
commit 37d4a523bb

View File

@ -398,7 +398,8 @@ class KeyboardData
public Key withKeyValue(int i, KeyValue kv) public Key withKeyValue(int i, KeyValue kv)
{ {
KeyValue[] ks = Arrays.copyOf(keys, keys.length); KeyValue[] ks = new KeyValue[keys.length];
for (int j = 0; j < keys.length; j++) ks[j] = keys[j];
ks[i] = kv; ks[i] = kv;
int flags = (keysflags & ~(ALL_FLAGS << i)); int flags = (keysflags & ~(ALL_FLAGS << i));
return new Key(ks, flags, width, shift, slider, indication); return new Key(ks, flags, width, shift, slider, indication);