mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-09 14:54:04 +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;
|
||||
}
|
||||
const length = this.#view.getUint32(offset);
|
||||
const stringData = new Uint8Array(length);
|
||||
stringData.set(new Uint8Array(this.#buffer, offset + 4, length));
|
||||
return this.#decoder.decode(stringData);
|
||||
return this.#decoder.decode(
|
||||
new Uint8Array(this.#buffer, offset + 4, length)
|
||||
);
|
||||
}
|
||||
|
||||
get fallbackName() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user