Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js8
-rw-r--r--lib/torrent.js3
2 files changed, 7 insertions, 4 deletions
diff --git a/index.js b/index.js
index 1f24c4b..4f4577d 100644
--- a/index.js
+++ b/index.js
@@ -199,9 +199,11 @@ WebTorrent.prototype.seed = function (input, opts, onseed) {
var streams
var torrent = self.add(undefined, opts, function (torrent) {
- var tasks = [function (cb) {
- torrent.load(streams, cb)
- }]
+ var tasks = [
+ function (cb) {
+ torrent.load(streams, cb)
+ }
+ ]
if (self.dht) {
tasks.push(function (cb) {
torrent.on('dhtAnnounce', cb)
diff --git a/lib/torrent.js b/lib/torrent.js
index 0275d70..6b58f77 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -796,7 +796,8 @@ Torrent.prototype._updateWire = function (wire) {
function validateWire () {
if (wire.requests.length) return
- for (var i = self._selections.length; i--;) {
+ var i = self._selections.length
+ while (i--) {
var next = self._selections[i]
var piece
if (self.strategy === 'rarest') {