Add a progressiveDataLength
fast-path to ChunkedStream.ensureByte
This is *similar* to the existing check using in `ChunkedStream.ensureRange`.
This commit is contained in:
parent
49e8a270c4
commit
c6ddbd55e2
@ -98,6 +98,10 @@ class ChunkedStream {
|
||||
}
|
||||
|
||||
ensureByte(pos) {
|
||||
if (pos < this.progressiveDataLength) {
|
||||
return;
|
||||
}
|
||||
|
||||
const chunk = Math.floor(pos / this.chunkSize);
|
||||
if (chunk === this.lastSuccessfulEnsureByteChunk) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user