Fix DataWord compareTo in convention with Comparable interface
This commit is contained in:
parent
7065c33487
commit
a2e8b18126
|
@ -282,9 +282,10 @@ public class DataWord implements Comparable<DataWord> {
|
|||
@Override
|
||||
public int compareTo(DataWord o) {
|
||||
if (o == null || o.getData() == null) return -1;
|
||||
|
||||
return FastByteComparisons.compareTo(
|
||||
int result = FastByteComparisons.compareTo(
|
||||
data, 0, data.length,
|
||||
o.getData(), 0, o.getData().length);
|
||||
// Convert result into -1, 0 or 1 as is the convention
|
||||
return (int) Math.signum(result);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue