Skip to content

Commit 170127b

Browse files
committed
[JAVA-85]: removed trick to compare inc wrap
1 parent b7d9986 commit 170127b

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/main/org/bson/types/ObjectId.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,7 @@ public int compareTo( ObjectId id ){
271271
if ( x != 0 )
272272
return x;
273273

274-
x = _compareUnsigned( _inc , id._inc );
275-
if (Math.abs(x) > Integer.MAX_VALUE / 2) {
276-
// this means that for same second and process more than (max int)/2 were generated
277-
// highly unlikely, most likely the counter wrapped
278-
if (x < 0)
279-
return 1;
280-
else
281-
return -1;
282-
}
283-
return x;
274+
return _compareUnsigned( _inc , id._inc );
284275
}
285276

286277
public int getMachine(){

0 commit comments

Comments
 (0)