Dev Ojha c648c93807 Fix random distribution in bitArray.PickRandom (#2534)
* Fix random distribution in bitArray.PickRandom

Previously it was very biased. 63 "_" followed by a single "x" had
much greater odds of being chosen. Additionally, the last element was
skewed. This fixes that by first preproccessing the set of all true
indices, and then randomly selecting a single element from there.

This commit also makes the code here significantly simpler, and
improves test cases.

* unlock mtx right after we select true indices
2018-10-05 11:00:50 +04:00
..
2018-07-01 22:36:03 -04:00
2018-07-02 12:06:43 -04:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-08-14 18:59:04 +04:00
2018-08-14 18:59:04 +04:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-07-02 12:06:43 -04:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-09-20 11:12:42 +02:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-08-27 10:43:15 +04:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-07-01 22:36:03 -04:00
2018-09-28 23:32:13 -04:00