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:
parent
49e8a270c4
commit
c6ddbd55e2
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue