1
0
mirror of https://github.com/fluencelabs/tendermint synced 2025-06-12 12:51:22 +00:00
Commit Graph

7 Commits

Author SHA1 Message Date
7fd51e6ade make govet linter pass ()
* make govet linter pass

Refs 

* close PipeReader and check for err
2019-02-11 16:31:34 +04:00
c648c93807 Fix random distribution in bitArray.PickRandom ()
* 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
0755a5203d bit_array: Simplify subtraction
also, fix potential bug in Or function
2018-10-03 11:29:04 +04:00
c94133ed1b Fix a bug in bit_array's sub function () 2018-10-03 10:28:46 +04:00
bc526f18a4 libs: Make bitarray functions lock parameters that aren't the caller ()
This now makes bit array functions which take in a second bit array, thread
safe. Previously there was a warning on bitarray.Update to be lock the
second parameter externally if thread safety wasrequired.
This was not done within the codebase, so it was fine to change here.

Closes 
2018-07-27 04:21:08 +02:00
6241e6b927 libs: update BitArray go docs () 2018-07-27 02:10:58 +02:00
ae3bf81833 mv tmlibs files to libs dir 2018-07-01 22:36:03 -04:00