优化代码

This commit is contained in:
刘祥超
2023-10-16 11:48:38 +08:00
parent d0f420a945
commit 3909695b44

View File

@@ -9,11 +9,13 @@ import (
"sync" "sync"
) )
const HashMapSharding = 11 const HashMapSharding = 31
var bigIntPool = sync.Pool{New: func() any { var bigIntPool = sync.Pool{
New: func() any {
return big.NewInt(0) return big.NewInt(0)
}} },
}
// FileListHashMap 文件Hash列表 // FileListHashMap 文件Hash列表
type FileListHashMap struct { type FileListHashMap struct {
@@ -63,7 +65,7 @@ func (this *FileListHashMap) Load(db *FileListDB) error {
this.AddHashes(hashList) this.AddHashes(hashList)
lastId = maxId lastId = maxId
maxLoops -- maxLoops--
if maxLoops <= 0 { if maxLoops <= 0 {
break break
} }