From ee2f403e527652fa3ae56cd659faabdd98e98295 Mon Sep 17 00:00:00 2001 From: Marcin Czenko Date: Wed, 26 Mar 2025 00:28:32 +0100 Subject: [PATCH] do not randomize piece fetching sequence for now --- codex/bittorrent/torrentdownloader.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codex/bittorrent/torrentdownloader.nim b/codex/bittorrent/torrentdownloader.nim index 85e1c5bd..f3170f66 100644 --- a/codex/bittorrent/torrentdownloader.nim +++ b/codex/bittorrent/torrentdownloader.nim @@ -73,11 +73,11 @@ proc newTorrentDownloader*( let queue = newAsyncQueue[TorrentPiece](maxsize = numOfPieces) - # optional: randomize the order of pieces - # not sure if this is such a great idea when streaming content let iter = Iter.new(0 ..< numOfPieces) var pieceDownloadSequence = newSeqWith(numOfPieces, iter.next()) - Rng.instance.shuffle(pieceDownloadSequence) + # optional: randomize the order of pieces + # not sure if this is such a great idea when streaming content + # Rng.instance.shuffle(pieceDownloadSequence) trace "Piece download sequence", pieceDownloadSequence