1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Add a progressiveDataLength fast-path to ChunkedStream.ensureByte

This is *similar* to the existing check using in `ChunkedStream.ensureRange`.
This commit is contained in:
Jonas Jenwald 2019-03-29 19:57:52 +01:00
parent 49e8a270c4
commit c6ddbd55e2

View file

@ -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;