#! /bin/sh /usr/share/dpatch/dpatch-run ## 10_sorthashcheck.dpatch by Micah Anderson ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ --- bittornado.orig/BitTornado/launchmanycore.py +++ bittornado/BitTornado/launchmanycore.py @@ -354,6 +354,7 @@ def hashchecksched(self, hash = None): if hash: self.hashcheck_queue.append(hash) + self.hashcheck_queue.sort(lambda x, y: cmp(self.downloads[x].d.datalength, self.downloads[y].d.datalength)) if not self.hashcheck_current: self._hashcheck_start()