mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Use Array.join to build up strings in readPostScriptTable().
This avoids about 5 MiB of string allocations on one test case.
This commit is contained in:
parent
584fef90ab
commit
1039791472
1 changed files with 4 additions and 3 deletions
|
@ -3430,13 +3430,14 @@ var Font = (function FontClosure() {
|
|||
break;
|
||||
}
|
||||
var customNames = [];
|
||||
var strBuf = [];
|
||||
while (font.pos < end) {
|
||||
var stringLength = font.getByte();
|
||||
var string = '';
|
||||
strBuf.length = stringLength;
|
||||
for (i = 0; i < stringLength; ++i) {
|
||||
string += String.fromCharCode(font.getByte());
|
||||
strBuf[i] = String.fromCharCode(font.getByte());
|
||||
}
|
||||
customNames.push(string);
|
||||
customNames.push(strBuf.join(''));
|
||||
}
|
||||
glyphNames = [];
|
||||
for (i = 0; i < numGlyphs; ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue