mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Enable the unicorn/no-array-push-push
ESLint plugin rule
There's generally speaking no need to use multiple consecutive `Array.prototype.push()` calls, since that method accepts multiple arguments, and this ESLint rule helps enforce that pattern. Please see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-push-push.md for additional information.
This commit is contained in:
parent
3538ef017f
commit
ec3bcadf56
9 changed files with 80 additions and 84 deletions
|
@ -856,8 +856,10 @@ function stringToUTF16BEString(str) {
|
|||
const buf = ["\xFE\xFF"];
|
||||
for (let i = 0, ii = str.length; i < ii; i++) {
|
||||
const char = str.charCodeAt(i);
|
||||
buf.push(String.fromCharCode((char >> 8) & 0xff));
|
||||
buf.push(String.fromCharCode(char & 0xff));
|
||||
buf.push(
|
||||
String.fromCharCode((char >> 8) & 0xff),
|
||||
String.fromCharCode(char & 0xff)
|
||||
);
|
||||
}
|
||||
return buf.join("");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue