mirror of https://github.com/encounter/SDL.git
Replaced search loop with indexOf() in Java file.
This commit is contained in:
parent
bbf0f62be9
commit
305f64ba2e
|
@ -853,7 +853,6 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler {
|
||||||
@Override
|
@Override
|
||||||
public int getNumJoysticks() {
|
public int getNumJoysticks() {
|
||||||
createJoystickList();
|
createJoystickList();
|
||||||
|
|
||||||
return mJoyIdList.size();
|
return mJoyIdList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -871,17 +870,8 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getJoyId(int devId) {
|
public int getJoyId(int devId) {
|
||||||
int i=0;
|
|
||||||
|
|
||||||
createJoystickList();
|
createJoystickList();
|
||||||
|
return mJoyIdList.indexOf(Integer.valueOf(devId));
|
||||||
for(i=0; i<mJoyIdList.size(); i++) {
|
|
||||||
if(mJoyIdList.get(i).intValue() == devId) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue