From 699f5ede1c622fb927ec0e4b1e6dd161e8f85dcc Mon Sep 17 00:00:00 2001 From: wangjingcun Date: Fri, 25 Oct 2024 10:41:41 +0800 Subject: [PATCH] fix: fix slice init length (#238) --- store/mysql/store_log_big_contract.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/mysql/store_log_big_contract.go b/store/mysql/store_log_big_contract.go index 1c889bb0..0b8dea1d 100644 --- a/store/mysql/store_log_big_contract.go +++ b/store/mysql/store_log_big_contract.go @@ -131,7 +131,7 @@ func (bcls *bigContractLogStore) migrate(contract *Contract, partition bnPartiti aidb := dbTx.Table(aiTableName).Where("cid = ?", contract.ID) res := aidb.FindInBatches(&aiLogs, defaultBatchSizeLogInsert, func(tx *gorm.DB, batch int) error { - deleteIds := make([]uint64, len(aiLogs)) + deleteIds := make([]uint64, 0, len(aiLogs)) clLogs := make([]*contractLog, 0, len(aiLogs)) for _, aiLog := range aiLogs {