mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-22 14:56:56 +00:00
merger: Pass pointers, not structs
just in one function, where two of them are passed at once. This was causing errors because it was too large to fit the stack.
This commit is contained in:
@@ -48,14 +48,15 @@ func (smartMerger) Merge(reports []report.Report) report.Report {
|
||||
case 1:
|
||||
return reports[0]
|
||||
}
|
||||
c := make(chan report.Report, l)
|
||||
c := make(chan *report.Report, l)
|
||||
for _, r := range reports {
|
||||
c <- r
|
||||
c <- &r
|
||||
}
|
||||
for ; l > 1; l-- {
|
||||
go func(left, right report.Report) {
|
||||
c <- left.Merge(right)
|
||||
go func(left, right *report.Report) {
|
||||
r := left.Merge(*right)
|
||||
c <- &r
|
||||
}(<-c, <-c)
|
||||
}
|
||||
return <-c
|
||||
return *<-c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user