From 1c7ca62ed560e705245ca2d8785c5f9b1b69c703 Mon Sep 17 00:00:00 2001 From: Sydonian <794346190@qq.com> Date: Fri, 22 Nov 2024 20:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/pkgs/db2/object.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/pkgs/db2/object.go b/common/pkgs/db2/object.go index e365057..a8bb0bd 100644 --- a/common/pkgs/db2/object.go +++ b/common/pkgs/db2/object.go @@ -262,7 +262,7 @@ func (db *ObjectDB) BatchAdd(ctx SQLContext, packageID cdssdk.PackageID, adds [] } // 创建 ObjectBlock - objBlocks := make([]stgmod.ObjectBlock, len(adds)) + objBlocks := make([]stgmod.ObjectBlock, 0, len(adds)) for i, add := range adds { for _, stgID := range add.StorageIDs { objBlocks = append(objBlocks, stgmod.ObjectBlock{ @@ -278,7 +278,7 @@ func (db *ObjectDB) BatchAdd(ctx SQLContext, packageID cdssdk.PackageID, adds [] } // 创建 Cache - caches := make([]model.Cache, len(adds)) + caches := make([]model.Cache, 0, len(adds)) for _, add := range adds { for _, stgID := range add.StorageIDs { caches = append(caches, model.Cache{