ttorrent
ttorrent copied to clipboard
Optimize Piece-s memory usage
Remove a couple of unnecessary fields from the Piece class :
- offset -> can be calculated from index * pieceLength
- seeder -> torrent.isSeeder()
- bucket -> torrent.getBucket()
- hash -> which is equivalent with torrent.getPiecesHashes() from index*Torrent.PIECE_HASH_SIZE, so we don't have duplicate this information.