2
0
mirror of synced 2025-02-24 06:38:14 +00:00

Apply unconvert linter

This commit is contained in:
Matt Joiner 2016-04-04 15:28:25 +10:00
parent fda1cc3f7b
commit 82ee860e8d
2 changed files with 9 additions and 9 deletions

View File

@ -118,8 +118,8 @@ func (cl *Client) queuePieceCheck(t *Torrent, pieceIndex int) {
return
}
piece.QueuedForHash = true
t.publishPieceChange(int(pieceIndex))
go cl.verifyPiece(t, int(pieceIndex))
t.publishPieceChange(pieceIndex)
go cl.verifyPiece(t, pieceIndex)
}
// Queue a piece check if one isn't already queued, and the piece has never
@ -1377,7 +1377,7 @@ func (me *Client) connectionLoop(t *Torrent, c *connection) error {
for i, cp := range pexMsg.Added {
p := Peer{
IP: make([]byte, 4),
Port: int(cp.Port),
Port: cp.Port,
Source: peerSourcePEX,
}
if i < len(pexMsg.AddedFlags) && pexMsg.AddedFlags[i]&0x01 != 0 {
@ -1958,12 +1958,12 @@ func (cl *Client) announceTorrentDHT(t *Torrent, impliedPort bool) {
}
addPeers = append(addPeers, Peer{
IP: cp.IP[:],
Port: int(cp.Port),
Port: cp.Port,
Source: peerSourceDHT,
})
key := (&net.UDPAddr{
IP: cp.IP[:],
Port: int(cp.Port),
Port: cp.Port,
}).String()
allAddrs[key] = struct{}{}
}
@ -2228,7 +2228,7 @@ func (me *Client) pieceHashed(t *Torrent, piece int, correct bool) {
}
}
p.EverHashed = true
touchers := me.reapPieceTouches(t, int(piece))
touchers := me.reapPieceTouches(t, piece)
if correct {
err := p.Storage().MarkComplete()
if err != nil {
@ -2241,7 +2241,7 @@ func (me *Client) pieceHashed(t *Torrent, piece int, correct bool) {
me.dropConnection(t, c)
}
}
me.pieceChanged(t, int(piece))
me.pieceChanged(t, piece)
}
func (me *Client) onCompletedPiece(t *Torrent, piece int) {

View File

@ -351,7 +351,7 @@ func (t *Torrent) newMetadataExtensionMessage(c *connection, msgType int, piece
}
return pp.Message{
Type: pp.Extended,
ExtendedID: byte(c.PeerExtensionIDs["ut_metadata"]),
ExtendedID: c.PeerExtensionIDs["ut_metadata"],
ExtendedPayload: append(p, data...),
}
}
@ -643,7 +643,7 @@ func (t *Torrent) pieceLength(piece int) (len_ pp.Integer) {
if piece < 0 || piece >= t.info.NumPieces() {
return
}
if int(piece) == t.numPieces()-1 {
if piece == t.numPieces()-1 {
len_ = pp.Integer(t.length % t.info.PieceLength)
}
if len_ == 0 {