diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-05-18 14:25:58 +0400 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-05-18 14:25:58 +0400 |
commit | e404555b1ebba8c4888e097b1ca2a223c9cc59e4 (patch) | |
tree | f1efa2ee1c1ca0f2e95c4063ca69f3048b9831f6 /lib/fs_storage.js | |
parent | c8b6faa507e142c041962551dac53b01e6e0fb09 (diff) |
spaces
Diffstat (limited to 'lib/fs_storage.js')
-rw-r--r-- | lib/fs_storage.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/fs_storage.js b/lib/fs_storage.js index 124a3a1..0205ad7 100644 --- a/lib/fs_storage.js +++ b/lib/fs_storage.js @@ -65,9 +65,9 @@ function FSStorage (parsedTorrent, opts) { var pieceStart = index * pieceLength var pieceEnd = pieceStart + piece.length - var from = (fileStart < pieceStart) ? 0 : fileStart - pieceStart - var to = (fileEnd > pieceEnd) ? pieceLength : fileEnd - pieceStart - var offset = (fileStart > pieceStart) ? 0 : pieceStart - fileStart + var from = (fileStart < pieceStart) ? 0 : fileStart - pieceStart + var to = (fileEnd > pieceEnd) ? pieceLength : fileEnd - pieceStart + var offset = (fileStart > pieceStart) ? 0 : pieceStart - fileStart if (!self.piecesMap[index]) self.piecesMap[index] = [] @@ -183,13 +183,13 @@ FSStorage.prototype.close = function (cb) { var i = 0 function loop (err) { - if (i >= self.files.length) return cb() - if (err) return cb(err) - var next = self.files[i++] - if (!next || !next.fd) return process.nextTick(loop) - next.fd.close(loop) - } - - process.nextTick(loop) + if (i >= self.files.length) return cb() + if (err) return cb(err) + var next = self.files[i++] + if (!next || !next.fd) return process.nextTick(loop) + next.fd.close(loop) + } + + process.nextTick(loop) }) } |