]> Sergey Matveev's repositories - btrtrc.git/commitdiff
import pp peer_protocol in misc.go
authorMatt Joiner <anacrolix@gmail.com>
Tue, 7 Apr 2015 16:17:15 +0000 (02:17 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 7 Apr 2015 16:17:15 +0000 (02:17 +1000)
misc.go

diff --git a/misc.go b/misc.go
index 4fbd1ff76825cd6d60ff0ad690eda76cb58fe7e7..56d1f9c9e6dee1d27584828a143b0b9e35d47071 100644 (file)
--- a/misc.go
+++ b/misc.go
@@ -6,7 +6,7 @@ import (
        "fmt"
        "time"
 
-       "github.com/anacrolix/torrent/peer_protocol"
+       pp "github.com/anacrolix/torrent/peer_protocol"
 )
 
 const (
@@ -31,22 +31,22 @@ func (ih *InfoHash) HexString() string {
        return fmt.Sprintf("%x", ih[:])
 }
 
-func lastChunkSpec(pieceLength peer_protocol.Integer) (cs chunkSpec) {
+func lastChunkSpec(pieceLength pp.Integer) (cs chunkSpec) {
        cs.Begin = (pieceLength - 1) / chunkSize * chunkSize
        cs.Length = pieceLength - cs.Begin
        return
 }
 
 type chunkSpec struct {
-       Begin, Length peer_protocol.Integer
+       Begin, Length pp.Integer
 }
 
 type request struct {
-       Index peer_protocol.Integer
+       Index pp.Integer
        chunkSpec
 }
 
-func newRequest(index, begin, length peer_protocol.Integer) request {
+func newRequest(index, begin, length pp.Integer) request {
        return request{index, chunkSpec{begin, length}}
 }