Browse Source

Remove unnecessary null check in onKeyEvent

Co-authored-by: neph1 <[email protected]>
copilot-swe-agent[bot] 2 weeks ago
parent
commit
786f604577

+ 2 - 4
jme3-vehicle-creator/src/com/jme3/gde/vehiclecreator/VehicleEditorController.java

@@ -530,7 +530,7 @@ public class VehicleEditorController implements LookupListener, ActionListener {
      * @param kie the key input event
      * @param kie the key input event
      */
      */
     public void onKeyEvent(KeyInputEvent kie) {
     public void onKeyEvent(KeyInputEvent kie) {
-        String binding = null;
+        String binding;
         switch (kie.getKeyCode()) {
         switch (kie.getKeyCode()) {
             case KeyInput.KEY_A:
             case KeyInput.KEY_A:
                 binding = "VehicleEditor_Left";
                 binding = "VehicleEditor_Left";
@@ -553,9 +553,7 @@ public class VehicleEditorController implements LookupListener, ActionListener {
             default:
             default:
                 return;
                 return;
         }
         }
-        if (binding != null) {
-            onAction(binding, kie.isPressed(), 0);
-        }
+        onAction(binding, kie.isPressed(), 0);
     }
     }
 
 
     /**
     /**