改进缓存LFU算法

This commit is contained in:
刘祥超
2022-09-07 11:34:26 +08:00
parent 51037be772
commit f58a808c3a
4 changed files with 95 additions and 63 deletions

View File

@@ -107,6 +107,12 @@ func (this *FileListHashMap) IsReady() bool {
return this.isReady
}
func (this *FileListHashMap) Len() int {
this.locker.Lock()
defer this.locker.Unlock()
return len(this.m)
}
func (this *FileListHashMap) bigInt(hash string) uint64 {
var bigInt = big.NewInt(0)
bigInt.SetString(hash, 16)