Replaced search loop with indexOf() in Java file.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 10 Nov 2013 17:44:51 +0100
changeset 7938 735989a5d280
parent 7937 aa2c57356aa8
child 7939 8cff978e06e9
Replaced search loop with indexOf() in Java file.
android-project/src/org/libsdl/app/SDLActivity.java
--- a/android-project/src/org/libsdl/app/SDLActivity.java	Sun Nov 10 17:42:01 2013 +0100
+++ b/android-project/src/org/libsdl/app/SDLActivity.java	Sun Nov 10 17:44:51 2013 +0100
@@ -853,7 +853,6 @@
     @Override
     public int getNumJoysticks() {
         createJoystickList();
-        
         return mJoyIdList.size();
     }
     
@@ -871,17 +870,8 @@
     
     @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));
     }
     
 }