mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #19589 from Snuffleupagus/RunLengthStream-fill
Replace a loop with `TypedArray.prototype.fill()` in the `RunLengthStream` class
This commit is contained in:
commit
dfa6370161
1 changed files with 2 additions and 4 deletions
|
@ -48,11 +48,9 @@ class RunLengthStream extends DecodeStream {
|
|||
}
|
||||
} else {
|
||||
n = 257 - n;
|
||||
const b = repeatHeader[1];
|
||||
buffer = this.ensureBuffer(bufferLength + n + 1);
|
||||
for (let i = 0; i < n; i++) {
|
||||
buffer[bufferLength++] = b;
|
||||
}
|
||||
buffer.fill(repeatHeader[1], bufferLength, bufferLength + n);
|
||||
bufferLength += n;
|
||||
}
|
||||
this.bufferLength = bufferLength;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue