mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Merge pull request #16292 from calixteman/improve_cff_compiling
Avoid when it's possible to use Array.concat when compiling a CFF font
This commit is contained in:
commit
a44173ea51
1 changed files with 7 additions and 1 deletions
|
@ -1383,7 +1383,13 @@ class CFFCompiler {
|
|||
data: [],
|
||||
length: 0,
|
||||
add(data) {
|
||||
this.data = this.data.concat(data);
|
||||
if (data.length <= 65536) {
|
||||
// The number of arguments is limited, hence we just take 65536 as
|
||||
// limit because it isn't too high or too low.
|
||||
this.data.push(...data);
|
||||
} else {
|
||||
this.data = this.data.concat(data);
|
||||
}
|
||||
this.length = this.data.length;
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue