Skip to content

Commit

Permalink
Camel case requestStrategy package
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Apr 29, 2023
1 parent 79ab1ff commit a4989ec
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion request-strategy/ajwerner-btree.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package request_strategy
package requestStrategy

import (
"github.com/ajwerner/btree"
Expand Down
2 changes: 1 addition & 1 deletion request-strategy/order.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package request_strategy
package requestStrategy

import (
"bytes"
Expand Down
4 changes: 2 additions & 2 deletions request-strategy/peer.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package request_strategy
package requestStrategy

import (
"github.com/anacrolix/torrent/typed-roaring"
typedRoaring "github.com/anacrolix/torrent/typed-roaring"
)

type PeerRequestState struct {
Expand Down
2 changes: 1 addition & 1 deletion request-strategy/piece-request-order.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package request_strategy
package requestStrategy

import "github.com/anacrolix/torrent/metainfo"

Expand Down
2 changes: 1 addition & 1 deletion request-strategy/piece-request-order_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package request_strategy
package requestStrategy

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion request-strategy/piece.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package request_strategy
package requestStrategy

type ChunksIterFunc func(func(ChunkIndex))

Expand Down
2 changes: 1 addition & 1 deletion request-strategy/tidwall-btree.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package request_strategy
package requestStrategy

import (
"github.com/tidwall/btree"
Expand Down
2 changes: 1 addition & 1 deletion request-strategy/torrent.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package request_strategy
package requestStrategy

type Torrent interface {
IgnorePiece(int) bool
Expand Down
20 changes: 10 additions & 10 deletions requesting.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/anacrolix/multiless"
"github.com/lispad/go-generics-tools/binheap"

"github.com/anacrolix/torrent/request-strategy"
"github.com/anacrolix/torrent/typed-roaring"
requestStrategy "github.com/anacrolix/torrent/request-strategy"
typedRoaring "github.com/anacrolix/torrent/typed-roaring"
)

type (
Expand All @@ -23,8 +23,8 @@ type (
maxRequests = int
)

func (t *Torrent) requestStrategyPieceOrderState(i int) request_strategy.PieceRequestOrderState {
return request_strategy.PieceRequestOrderState{
func (t *Torrent) requestStrategyPieceOrderState(i int) requestStrategy.PieceRequestOrderState {
return requestStrategy.PieceRequestOrderState{
Priority: t.piece(i).purePriority(),
Partial: t.piecePartiallyDownloaded(i),
Availability: t.piece(i).availability(),
Expand Down Expand Up @@ -70,14 +70,14 @@ func (p *peerId) GobDecode(b []byte) error {
}

type (
RequestIndex = request_strategy.RequestIndex
chunkIndexType = request_strategy.ChunkIndex
RequestIndex = requestStrategy.RequestIndex
chunkIndexType = requestStrategy.ChunkIndex
)

type desiredPeerRequests struct {
requestIndexes []RequestIndex
peer *Peer
pieceStates []request_strategy.PieceRequestOrderState
pieceStates []requestStrategy.PieceRequestOrderState
}

func (p *desiredPeerRequests) Len() int {
Expand Down Expand Up @@ -204,10 +204,10 @@ func (p *Peer) getDesiredRequestState() (desired desiredRequestState) {
}
// Caller-provided allocation for roaring bitmap iteration.
var it typedRoaring.Iterator[RequestIndex]
request_strategy.GetRequestablePieces(
requestStrategy.GetRequestablePieces(
input,
t.getPieceRequestOrder(),
func(ih InfoHash, pieceIndex int, pieceExtra request_strategy.PieceRequestOrderState) {
func(ih InfoHash, pieceIndex int, pieceExtra requestStrategy.PieceRequestOrderState) {
if ih != t.infoHash {
return
}
Expand All @@ -216,7 +216,7 @@ func (p *Peer) getDesiredRequestState() (desired desiredRequestState) {
}
requestHeap.pieceStates[pieceIndex] = pieceExtra
allowedFast := p.peerAllowedFast.Contains(pieceIndex)
t.iterUndirtiedRequestIndexesInPiece(&it, pieceIndex, func(r request_strategy.RequestIndex) {
t.iterUndirtiedRequestIndexesInPiece(&it, pieceIndex, func(r requestStrategy.RequestIndex) {
if !allowedFast {
// We must signal interest to request this. TODO: We could set interested if the
// peers pieces (minus the allowed fast set) overlap with our missing pieces if
Expand Down

0 comments on commit a4989ec

Please sign in to comment.