fix range bounds check

This commit is contained in:
dfsek 2022-05-29 23:49:25 -07:00
parent da28244f81
commit ef1f1c0af0

View File

@ -19,7 +19,7 @@ public class ConstantRange implements Range {
private int max;
public ConstantRange(int min, int max) {
if(min > max) throw new IllegalArgumentException("Minimum must not be greater than maximum!");
if(min >= max) throw new IllegalArgumentException("Minimum must not be greater than or equal to maximum!");
this.max = max;
this.min = min;
}