Replaced search loop with indexOf() in Java file.

This commit is contained in:
Philipp Wiesemann 2013-11-10 17:44:51 +01:00
parent bbf0f62be9
commit 305f64ba2e

View File

@ -853,7 +853,6 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler {
@Override
public int getNumJoysticks() {
createJoystickList();
return mJoyIdList.size();
}
@ -871,17 +870,8 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler {
@Override
public int getJoyId(int devId) {
int i=0;
createJoystickList();
for(i=0; i<mJoyIdList.size(); i++) {
if(mJoyIdList.get(i).intValue() == devId) {
return i;
}
}
return -1;
return mJoyIdList.indexOf(Integer.valueOf(devId));
}
}