autopilot: append instead of appends in a loop
This commit is contained in:
parent
28c2ef12b2
commit
0679d1dd4b
@ -386,9 +386,8 @@ func mergeChanState(pendingChans map[NodeID]Channel,
|
|||||||
numChans := len(pendingChans) + len(activeChans)
|
numChans := len(pendingChans) + len(activeChans)
|
||||||
totalChans := make([]Channel, 0, numChans)
|
totalChans := make([]Channel, 0, numChans)
|
||||||
|
|
||||||
for _, activeChan := range activeChans.Channels() {
|
totalChans = append(totalChans, activeChans.Channels()...)
|
||||||
totalChans = append(totalChans, activeChan)
|
|
||||||
}
|
|
||||||
for _, pendingChan := range pendingChans {
|
for _, pendingChan := range pendingChans {
|
||||||
totalChans = append(totalChans, pendingChan)
|
totalChans = append(totalChans, pendingChan)
|
||||||
}
|
}
|
||||||
|
@ -139,10 +139,7 @@ func assertChoice(w []float64, iterations int) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The sum of choices must be exactly iterations of course.
|
// The sum of choices must be exactly iterations of course.
|
||||||
if totalChoices != iterations {
|
return totalChoices == iterations
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user