Skip to content

Commit

Permalink
pre set the limit of slice
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong committed May 3, 2024
1 parent cd54f43 commit cf1e577
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backend/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1293,11 +1293,10 @@ func (tm *TorrentManager) activeLoop() {
}
}*/

var clean = []*caffe.Torrent{}
var clean = make([]*caffe.Torrent, 0, tm.torrents.Len())
tm.torrents.Range(func(ih string, t *caffe.Torrent) bool {
if t.Running() {
if t.Torrent.BytesMissing() == 0 {
//tm.finish(t)
clean = append(clean, t)
} else {
if t.Torrent.BytesCompleted() < t.BytesRequested() {
Expand Down

0 comments on commit cf1e577

Please sign in to comment.