Skip to content
This repository was archived by the owner on Dec 28, 2022. It is now read-only.

Commit d16e6ac

Browse files
committed
fix blocks when start, end are set
1 parent c586d19 commit d16e6ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/replicator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -910,9 +910,9 @@ module.exports = class Replicator {
910910
}
911911

912912
addRange (session, { start = 0, end = -1, length = toLength(start, end), blocks = null, linear = false } = {}) {
913-
if (blocks !== null) {
914-
if (start >= blocks.length) start = blocks.length
915-
if (length === -1 || start + length > blocks.length) length = blocks.length - start
913+
if (blocks !== null) { // if using blocks, start, end just acts as frames around the blocks array
914+
start = 0
915+
end = length = blocks.length
916916
}
917917

918918
const r = new RangeRequest(this._ranges, start, length === -1 ? -1 : start + length, linear, blocks)

0 commit comments

Comments
 (0)