We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 651e53b commit 0db2941Copy full SHA for 0db2941
bson/src/main/org/bson/types/ObjectId.java
@@ -409,7 +409,7 @@ public int compareTo(final ObjectId other) {
409
byte[] otherByteArray = other.toByteArray();
410
for (int i = 0; i < 12; i++) {
411
if (byteArray[i] != otherByteArray[i]) {
412
- return Integer.compare(byteArray[i] & 0xff, otherByteArray[i] & 0xff);
+ return ((byteArray[i] & 0xff) < (otherByteArray[i] & 0xff)) ? -1 : 1;
413
}
414
415
return 0;
0 commit comments