1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 06:38:07 +02:00

Merge pull request #19596 from Snuffleupagus/Array-methods-arrow-functions

Use arrow function with various Array methods
This commit is contained in:
Tim van der Meij 2025-03-02 16:09:09 +01:00 committed by GitHub
commit 146bc58f32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 16 additions and 46 deletions

View file

@ -398,9 +398,7 @@ class Stepper {
}
getNextBreakPoint() {
this.breakPoints.sort(function (a, b) {
return a - b;
});
this.breakPoints.sort((a, b) => a - b);
for (const breakPoint of this.breakPoints) {
if (breakPoint > this.currentIdx) {
return breakPoint;
@ -487,9 +485,7 @@ const Stats = (function Stats() {
statsDiv.textContent = stat.toString();
wrapper.append(title, statsDiv);
stats.push({ pageNumber, div: wrapper });
stats.sort(function (a, b) {
return a.pageNumber - b.pageNumber;
});
stats.sort((a, b) => a.pageNumber - b.pageNumber);
clear(this.panel);
for (const entry of stats) {
this.panel.append(entry.div);