We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 717937d + 25131f0 commit 17f3168Copy full SHA for 17f3168
site/static/compare.html
@@ -650,8 +650,23 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
650
b: format(b),
651
percent: 100 * (b - a) / a
652
};
653
- })
654
- .sort((a, b) => Math.abs(b.percent) - Math.abs(a.percent));
+ }).sort((a, b) => {
+ let bp = Math.abs(b.percent);
655
+ if (Number.isNaN(bp)) {
656
+ bp = 0;
657
+ }
658
+ let ap = Math.abs(a.percent);
659
+ if (Number.isNaN(ap)) {
660
+ ap = 0;
661
662
+ if (bp < ap) {
663
+ return -1;
664
+ } else if (bp > ap) {
665
+ return 1;
666
+ } else {
667
+ return a.name.localeCompare(b.name);
668
669
+ });
670
},
671
before() {
672
if (!this.data) {
0 commit comments