From 71e5858366cb89c8d9aefaafeb62754592f42e0b Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Thu, 21 Sep 2023 09:15:12 +0800 Subject: [PATCH] statistics: remove useless copy in the MergePartitionStats2GlobalStats (#47144) --- statistics/handle/globalstats/global_stats.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/statistics/handle/globalstats/global_stats.go b/statistics/handle/globalstats/global_stats.go index a3e15dc25aedf..a61d7c010d460 100644 --- a/statistics/handle/globalstats/global_stats.go +++ b/statistics/handle/globalstats/global_stats.go @@ -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 { @@ -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()