Jelajahi Sumber

Fixed code style

Sam Lantinga 7 tahun lalu
induk
melakukan
6b3f11e2a3
1 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 2 3
      src/joystick/SDL_joystick.c

+ 2 - 3
src/joystick/SDL_joystick.c

@@ -582,12 +582,11 @@ SDL_JoystickFromInstanceID(SDL_JoystickID joyid)
     SDL_LockJoysticks();
     for (joystick = SDL_joysticks; joystick; joystick = joystick->next) {
         if (joystick->instance_id == joyid) {
-            SDL_UnlockJoysticks();
-            return joystick;
+            break;
         }
     }
     SDL_UnlockJoysticks();
-    return NULL;
+    return joystick;
 }
 
 /*