Skip to content

Commit

Permalink
Replaced search loop with indexOf() in Java file.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed Nov 10, 2013
1 parent bbf0f62 commit 305f64b
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions android-project/src/org/libsdl/app/SDLActivity.java
Expand Up @@ -853,7 +853,6 @@ private void createJoystickList() {
@Override
public int getNumJoysticks() {
createJoystickList();

return mJoyIdList.size();
}

Expand All @@ -871,17 +870,8 @@ public int getJoystickAxes(int joy) {

@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));
}

}
Expand Down

0 comments on commit 305f64b

Please sign in to comment.