use an array with a definite num of elements before adding concurrency
This commit is contained in:
parent
f85d128780
commit
1c8542bdc4
|
@ -135,7 +135,8 @@ func main() {
|
|||
|
||||
var r = rand.New(rand.NewPCG(uint64(1), uint64(2)))
|
||||
|
||||
var dists []IntProbsWeights
|
||||
n_dists := 10_000
|
||||
var dists = make([]IntProbsWeights, n_dists)
|
||||
|
||||
sum_weights := int64(0)
|
||||
for i := 0; i < 10_000; i++ {
|
||||
|
@ -149,7 +150,7 @@ func main() {
|
|||
if result > 0 {
|
||||
// fmt.Println(people_known_distribution)
|
||||
// fmt.Println(result)
|
||||
dists = append(dists, IntProbsWeights{IntProbs: people_known_distribution, w: result})
|
||||
dists[i] = IntProbsWeights{IntProbs: people_known_distribution, w: result}
|
||||
}
|
||||
sum_weights += result
|
||||
// fmt.Println(result)
|
||||
|
|
Loading…
Reference in New Issue
Block a user