From d1797deccb817ae89edda016d192bcf45f80ea32 Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 21 Dec 2022 14:15:11 -0800 Subject: [PATCH] remove duplicated logic of removing from writableChunks --- weed/mount/page_writer/upload_pipeline.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/weed/mount/page_writer/upload_pipeline.go b/weed/mount/page_writer/upload_pipeline.go index bce062a6e..252dddc06 100644 --- a/weed/mount/page_writer/upload_pipeline.go +++ b/weed/mount/page_writer/upload_pipeline.go @@ -73,9 +73,7 @@ func (up *UploadPipeline) SaveDataAt(p []byte, off int64, isSequential bool) (n fullness = chunkFullness } } - fullWritableChunk := up.writableChunks[fullestChunkIndex] - delete(up.writableChunks, fullestChunkIndex) - up.moveToSealed(fullWritableChunk, fullestChunkIndex) + up.moveToSealed(up.writableChunks[fullestChunkIndex], fullestChunkIndex) // fmt.Printf("flush chunk %d with %d bytes written\n", logicChunkIndex, fullness) } if isSequential &&