2
0
mirror of synced 2025-02-24 14:48:27 +00:00

Inlineable (*Torrent).BytesMissing() (#633)

Honestly a name like `BytesLeft` would have been more suitable, but it's too late for that I guess.
This commit is contained in:
YenForYang 2021-09-26 21:43:09 -05:00 committed by GitHub
parent 644a746b6b
commit 86fe6cc872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -736,10 +736,12 @@ func (t *Torrent) newMetaInfo() metainfo.MetaInfo {
} }
} }
func (t *Torrent) BytesMissing() int64 { // Get bytes left
func (t *Torrent) BytesMissing() (n int64) {
t.cl.rLock() t.cl.rLock()
defer t.cl.rUnlock() n = t.bytesMissingLocked()
return t.bytesMissingLocked() t.cl.rUnlock()
return
} }
func (t *Torrent) bytesMissingLocked() int64 { func (t *Torrent) bytesMissingLocked() int64 {