package metainfo
-import (
- "github.com/anacrolix/missinggo"
-)
-
type Piece struct {
Info *Info // Can we embed the fields here instead, or is it something to do with saving memory?
i pieceIndex
}
func (p Piece) Hash() (ret Hash) {
- missinggo.CopyExact(&ret, p.Info.Pieces[p.i*HashSize:(p.i+1)*HashSize])
+ copy(ret[:], p.Info.Pieces[p.i*HashSize:(p.i+1)*HashSize])
return
}