From efd40854fb03111f07c20b7d045a6cf067d7bc42 Mon Sep 17 00:00:00 2001 From: Dustin Xie Date: Tue, 30 Apr 2024 13:05:57 -0700 Subject: [PATCH] [db] avoid clone batch --- db/batch/batch_impl.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/db/batch/batch_impl.go b/db/batch/batch_impl.go index 49dc7f4235..7955ae28ac 100644 --- a/db/batch/batch_impl.go +++ b/db/batch/batch_impl.go @@ -153,12 +153,7 @@ func (b *baseKVStoreBatch) Translate(wit WriteInfoTranslate) KVStoreBatch { b.mutex.Lock() defer b.mutex.Unlock() if wit == nil { - c := &baseKVStoreBatch{ - writeQueue: make([]*WriteInfo, b.Size()), - } - // clone the writeQueue - copy(c.writeQueue, b.writeQueue) - return c + return b } c := &baseKVStoreBatch{ writeQueue: []*WriteInfo{},