Commit f16e725b authored by cui's avatar cui Committed by GitHub

refactor: using maps.Copy (#11544)

parent 185fb80d
...@@ -2,6 +2,7 @@ package main ...@@ -2,6 +2,7 @@ package main
import ( import (
"errors" "errors"
"maps"
"sort" "sort"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
...@@ -96,9 +97,8 @@ func checkBlockRanges(aggregates []aggregate) error { ...@@ -96,9 +97,8 @@ func checkBlockRanges(aggregates []aggregate) error {
func mergeAggregates(a1, a2 aggregate, log log.Logger) aggregate { func mergeAggregates(a1, a2 aggregate, log log.Logger) aggregate {
log.Info("merging", "a1", a1, "a2", a2) log.Info("merging", "a1", a1, "a2", a2)
// merge the results // merge the results
for k, v := range a2.Results { maps.Copy(a1.Results, a2.Results)
a1.Results[k] = v
}
a1.Last = a2.Last a1.Last = a2.Last
log.Info("result", "aggregate", a1) log.Info("result", "aggregate", a1)
return a1 return a1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment