Skip to content

Commit 786f604

Browse files
Copilotneph1
andcommitted
Remove unnecessary null check in onKeyEvent
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
1 parent e13d1a6 commit 786f604

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ public void onAction(String binding, boolean value, float f) {
530530
* @param kie the key input event
531531
*/
532532
public void onKeyEvent(KeyInputEvent kie) {
533-
String binding = null;
533+
String binding;
534534
switch (kie.getKeyCode()) {
535535
case KeyInput.KEY_A:
536536
binding = "VehicleEditor_Left";
@@ -553,9 +553,7 @@ public void onKeyEvent(KeyInputEvent kie) {
553553
default:
554554
return;
555555
}
556-
if (binding != null) {
557-
onAction(binding, kie.isPressed(), 0);
558-
}
556+
onAction(binding, kie.isPressed(), 0);
559557
}
560558

561559
/**

0 commit comments

Comments
 (0)