belliottsmith commented on code in PR #73:
URL: https://github.com/apache/cassandra-accord/pull/73#discussion_r1410515403


##########
accord-core/src/test/java/accord/utils/RandomSourceTest.java:
##########
@@ -111,18 +104,101 @@ private double testOneBiasedLongs(RandomSource random, 
int min, int median, int
             results[i] = random.nextBiasedInt(min, median, max);
 
         Arrays.sort(results);
-        int i = Arrays.binarySearch(results, median);
+        int i = firstBinarySearch(results, median);
         if (i < 0) i = -1 - i;
-        int j = Arrays.binarySearch(results, median + 1);
+        int j = firstBinarySearch(results, median + 1);
         if (j < 0) j = -2 - j;
         else --j;
-        i -= results.length/2;
-        j -= results.length/2;
+        i -= Math.abs(results.length/2);

Review Comment:
   I don't think this is necessary? It's not possible for `results.length/2` to 
be negative?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to