Merge "Remove redundant array allocation." into udc-dev

This commit is contained in:
Vladimir Komsiyski
2023-03-29 11:47:36 +00:00
committed by Android (Google) Code Review

View File

@@ -338,9 +338,7 @@ class InputController {
}
synchronized (mLock) {
InputDeviceDescriptor[] values = mInputDeviceDescriptors.values().toArray(
new InputDeviceDescriptor[0]);
for (InputDeviceDescriptor value : values) {
for (InputDeviceDescriptor value : mInputDeviceDescriptors.values()) {
if (value.mName.equals(deviceName)) {
throw new DeviceCreationException(
"Input device name already in use: " + deviceName);