Skip to content

Commit

Permalink
A rather insignificant "optimization"
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Oct 7, 2024
1 parent 89c7f1a commit a39155a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arc-core/src/arc/math/Mathf.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public static float clamp(float value, float min, float max){

/** Clamps to [0, 1]. */
public static float clamp(float value){
return clamp(value, 0f, 1f);
return Math.max(Math.min(value, 1f), 0f);
}

public static double clamp(double value, double min, double max){
Expand Down

0 comments on commit a39155a

Please sign in to comment.