Properly compare against MIN/MAX_VALUE
This commit is contained in:
@@ -24,8 +24,8 @@ class DoubleArgumentPropertySerializer implements ArgumentPropertySerializer<Dou
|
||||
|
||||
@Override
|
||||
public void serialize(DoubleArgumentType object, ByteBuf buf) {
|
||||
boolean hasMinimum = object.getMinimum() != Double.MIN_VALUE;
|
||||
boolean hasMaximum = object.getMaximum() != Double.MAX_VALUE;
|
||||
boolean hasMinimum = Double.compare(object.getMinimum(), Double.MIN_VALUE) != 0;
|
||||
boolean hasMaximum = Double.compare(object.getMaximum(), Double.MAX_VALUE) != 0;
|
||||
byte flag = getFlags(hasMinimum, hasMaximum);
|
||||
|
||||
buf.writeByte(flag);
|
||||
|
@@ -25,8 +25,8 @@ class FloatArgumentPropertySerializer implements ArgumentPropertySerializer<Floa
|
||||
|
||||
@Override
|
||||
public void serialize(FloatArgumentType object, ByteBuf buf) {
|
||||
boolean hasMinimum = object.getMinimum() != Float.MIN_VALUE;
|
||||
boolean hasMaximum = object.getMaximum() != Float.MAX_VALUE;
|
||||
boolean hasMinimum = Float.compare(object.getMinimum(), Float.MIN_VALUE) != 0;
|
||||
boolean hasMaximum = Float.compare(object.getMaximum(), Float.MAX_VALUE) != 0;
|
||||
byte flag = getFlags(hasMinimum, hasMaximum);
|
||||
|
||||
buf.writeByte(flag);
|
||||
|
Reference in New Issue
Block a user