From 3909695b44465a6c04195d3a2fe724be739538ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Mon, 16 Oct 2023 11:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/list_file_hash_map.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/caches/list_file_hash_map.go b/internal/caches/list_file_hash_map.go index 6a2652c..625de3d 100644 --- a/internal/caches/list_file_hash_map.go +++ b/internal/caches/list_file_hash_map.go @@ -9,11 +9,13 @@ import ( "sync" ) -const HashMapSharding = 11 +const HashMapSharding = 31 -var bigIntPool = sync.Pool{New: func() any { - return big.NewInt(0) -}} +var bigIntPool = sync.Pool{ + New: func() any { + return big.NewInt(0) + }, +} // FileListHashMap 文件Hash列表 type FileListHashMap struct { @@ -63,7 +65,7 @@ func (this *FileListHashMap) Load(db *FileListDB) error { this.AddHashes(hashList) lastId = maxId - maxLoops -- + maxLoops-- if maxLoops <= 0 { break }