0
我發現這個代碼庫下面,有人這樣評價我們的方法,象這樣創建蘭特結構
// TODO avoid using rand.Float64 method. it uses a singleton lock and may cause
// performance issues. Instead, instantiate a rand struct and use that to call
// Float64()
func standardStrategy(l *ledger) bool {
return rand.Float64() <= probabilitySend(l.Accounting.Value())
}
func probabilitySend(ratio float64) float64 {
x := 1 + math.Exp(6-3*ratio)
y := 1/x
return 1 - y
}
一個TODO這是什麼意思?