mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-03 05:35:49 +02:00
Merge pull request #20986 from Snuffleupagus/FontInfo-readString-simplify
Reduce allocations in the `FontInfo.prototype.#readString` method (PR 20197 follow-up)
This commit is contained in:
commit
f52a50ba09
@ -247,9 +247,9 @@ class FontInfo {
|
|||||||
offset += this.#view.getUint32(offset) + 4;
|
offset += this.#view.getUint32(offset) + 4;
|
||||||
}
|
}
|
||||||
const length = this.#view.getUint32(offset);
|
const length = this.#view.getUint32(offset);
|
||||||
const stringData = new Uint8Array(length);
|
return this.#decoder.decode(
|
||||||
stringData.set(new Uint8Array(this.#buffer, offset + 4, length));
|
new Uint8Array(this.#buffer, offset + 4, length)
|
||||||
return this.#decoder.decode(stringData);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get fallbackName() {
|
get fallbackName() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user