Skip to content

Commit

Permalink
move Range type closer to its usage
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Apr 10, 2020
1 parent 775890b commit 6fa5a29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 0 additions & 11 deletions internal/piecepicker/piecepicker.go
Expand Up @@ -335,14 +335,3 @@ func (p *PiecePicker) pickStalled(pe *peer.Peer) *myPiece {
}
return nil
}

// Range is a piece range.
// Begin is inclusive, End is exclusive.
type Range struct {
Begin, End uint32
}

// Len returns the number of pieces in the range.
func (r Range) Len() uint32 {
return r.End - r.Begin
}
11 changes: 11 additions & 0 deletions internal/piecepicker/webseed.go
Expand Up @@ -155,3 +155,14 @@ func (p *PiecePicker) pickLastPieceOfSmallestGap(pe *peer.Peer) *myPiece {
}
return nil
}

// Range is a piece range.
// Begin is inclusive, End is exclusive.
type Range struct {
Begin, End uint32
}

// Len returns the number of pieces in the range.
func (r Range) Len() uint32 {
return r.End - r.Begin
}

0 comments on commit 6fa5a29

Please sign in to comment.