autopilot: append instead of appends in a loop

This commit is contained in:
Andras Banki-Horvath committed 2020-04-24 19:15:08 +02:00
1 parent 28c2ef12b2
commit 0679d1dd4b
2 files changed
+3 -7

No files matched your search

+2 -3
View File
@@ -386,9 +386,8 @@ func mergeChanState(pendingChans map[NodeID]Channel,
numChans := len(pendingChans) + len(activeChans)
totalChans := make([]Channel, 0, numChans)
for _, activeChan := range activeChans.Channels() {
totalChans = append(totalChans, activeChan)
}
totalChans = append(totalChans, activeChans.Channels()...)
for _, pendingChan := range pendingChans {
totalChans = append(totalChans, pendingChan)
}