mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-20 05:56:10 +05:00
fix remove pieces
This commit is contained in:
@@ -90,21 +90,21 @@ func (b *BufferPool) ReleaseBuffer(index int) {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BufferPool) Used() map[int]struct{} {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
if len(b.buffs) == 0 {
|
||||
b.mkBuffs()
|
||||
}
|
||||
used := make(map[int]struct{})
|
||||
for _, b := range b.buffs {
|
||||
if b.used {
|
||||
used[b.pieceId] = struct{}{}
|
||||
}
|
||||
}
|
||||
return used
|
||||
}
|
||||
|
||||
func (b *BufferPool) Len() int {
|
||||
return b.frees
|
||||
}
|
||||
//func (b *BufferPool) Used() map[int]struct{} {
|
||||
// b.mu.Lock()
|
||||
// defer b.mu.Unlock()
|
||||
// if len(b.buffs) == 0 {
|
||||
// b.mkBuffs()
|
||||
// }
|
||||
// used := make(map[int]struct{})
|
||||
// for _, b := range b.buffs {
|
||||
// if b.used {
|
||||
// used[b.pieceId] = struct{}{}
|
||||
// }
|
||||
// }
|
||||
// return used
|
||||
//}
|
||||
//
|
||||
//func (b *BufferPool) Len() int {
|
||||
// return b.frees
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user