chore: aria2 related function

This commit is contained in:
Noah Hsu
2022-06-20 20:34:58 +08:00
parent 4db25605e7
commit 6c552a9d62
9 changed files with 120 additions and 2 deletions

View File

@ -347,6 +347,13 @@ func (m *MapOf[K, V]) Values() []V {
return values
}
func (m *MapOf[K, V]) Clear() {
m.Range(func(key K, value V) bool {
m.Delete(key)
return true
})
}
func (m *MapOf[K, V]) missLocked() {
m.misses++
if m.misses < len(m.dirty) {