Skip to content

Commit 91f7526

Browse files
committed
1 parent b0c8691 commit 91f7526

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lazyFile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ export class LazyUint8Array {
9595
private moveReadHead(wantedChunkNum: number): ReadHead {
9696
for (const [i, head] of this.readHeads.entries()) {
9797
const fetchStartChunkNum = head.startChunk + head.speed;
98-
const newSpeed = head.speed * 2;
98+
const newSpeed = Math.min(this.maxSpeed, head.speed * 2);
9999
const wantedIsInNextFetchOfHead =
100100
wantedChunkNum >= fetchStartChunkNum &&
101101
wantedChunkNum < fetchStartChunkNum + newSpeed;
102102
if (wantedIsInNextFetchOfHead) {
103-
head.speed = Math.min(this.maxSpeed, newSpeed);
103+
head.speed = newSpeed;
104104
head.startChunk = fetchStartChunkNum;
105105
if (i !== 0) {
106106
// move head to front

0 commit comments

Comments
 (0)