Skip to content

Commit

Permalink
statistics: remove useless copy in the MergePartitionStats2GlobalStats (
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei committed Sep 21, 2023
1 parent 3b21c7a commit 71e5858
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions statistics/handle/globalstats/global_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func MergePartitionStats2GlobalStats(
continue
}
// Merge CMSketch.
globalStats.Cms[i] = allCms[i][0].Copy()
globalStats.Cms[i] = allCms[i][0]
for j := 1; j < len(allCms[i]); j++ {
err = globalStats.Cms[i].MergeCMSketch(allCms[i][j])
if err != nil {
Expand Down Expand Up @@ -239,7 +239,7 @@ func MergePartitionStats2GlobalStats(
}

// Merge FMSketch.
globalStats.Fms[i] = allFms[i][0].Copy()
globalStats.Fms[i] = allFms[i][0]
for j := 1; j < len(allFms[i]); j++ {
globalStats.Fms[i].MergeFMSketch(allFms[i][j])
allFms[i][j].DestroyAndPutToPool()
Expand Down

0 comments on commit 71e5858

Please sign in to comment.