Reduce usage of the arrayByteLength helper function

We're using this helper function when reading data from the [`PDFWorkerStreamReader.read`](a49d1d1615/src/core/worker_stream.js (L90-L98)) and [`PDFWorkerStreamRangeReader.read`](a49d1d1615/src/core/worker_stream.js (L122-L128)) methods, and as can be seen they always return `ArrayBuffer` data. Hence we can simply get the `byteLength` directly, and don't need to use the helper function.

Note that at the time when `arrayByteLength` was added we still supported browsers without TypedArray functionality, and we'd then simulate them using regular Arrays.
This commit is contained in:
Jonas Jenwald 2023-02-09 15:49:13 +01:00
parent 323d3d246a
commit 96d338e437
3 changed files with 24 additions and 7 deletions

View file

@ -1115,7 +1115,6 @@ export {
AnnotationReviewState,
AnnotationStateModelType,
AnnotationType,
arrayByteLength,
arraysToBytes,
assert,
BaseException,