chore: Use xsync provided map size calculation

This commit is contained in:
H1JK
2023-09-02 20:17:43 +08:00
parent 1cad615b25
commit d6b80acfbc
3 changed files with 67 additions and 41 deletions

View File

@ -355,13 +355,7 @@ func (p *Proxy) determineFinalStoreType(store C.DelayHistoryStoreType, url strin
return C.OriginalHistory
}
length := 0
p.extra.Range(func(_ string, _ *extraProxyState) bool {
length++
return length < 2*C.DefaultMaxHealthCheckUrlNum
})
if length == 0 {
if p.extra.Size() < 2*C.DefaultMaxHealthCheckUrlNum {
return C.ExtraHistory
}
@ -370,9 +364,5 @@ func (p *Proxy) determineFinalStoreType(store C.DelayHistoryStoreType, url strin
return C.ExtraHistory
}
if length < 2*C.DefaultMaxHealthCheckUrlNum {
return C.ExtraHistory
}
return store
}