mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
A tiny improvement of the MetadataParser._repair
method
We can just insert the initial greater-than sign at the start of the buffer, rather than doing that manually at the end.
This commit is contained in:
parent
851c394e64
commit
3a7fce49a3
1 changed files with 2 additions and 2 deletions
|
@ -57,7 +57,7 @@ class MetadataParser {
|
|||
throw new Error(`_repair: ${name} isn't defined.`);
|
||||
});
|
||||
|
||||
const charBuf = [];
|
||||
const charBuf = [">"];
|
||||
for (let i = 0, ii = bytes.length; i < ii; i += 2) {
|
||||
const code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1);
|
||||
if (
|
||||
|
@ -74,7 +74,7 @@ class MetadataParser {
|
|||
);
|
||||
}
|
||||
}
|
||||
return ">" + charBuf.join("");
|
||||
return charBuf.join("");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue