diff --git a/engine/src/core/com/jme3/collision/CollisionResult.java b/engine/src/core/com/jme3/collision/CollisionResult.java index aef39367f..4da2ac386 100644 --- a/engine/src/core/com/jme3/collision/CollisionResult.java +++ b/engine/src/core/com/jme3/collision/CollisionResult.java @@ -99,12 +99,7 @@ public class CollisionResult implements Comparable { } public int compareTo(CollisionResult other) { - if (distance < other.distance) - return -1; - else if (distance > other.distance) - return 1; - else - return 0; + return Float.compare(distance, other.distance); } @Override