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.
1 parent 0fd4b10 commit 25131f0Copy full SHA for 25131f0
site/static/compare.html
@@ -653,8 +653,23 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
653
b: format(b),
654
percent: 100 * (b - a) / a
655
};
656
- })
657
- .sort((a, b) => Math.abs(b.percent) - Math.abs(a.percent));
+ }).sort((a, b) => {
+ let bp = Math.abs(b.percent);
658
+ if (Number.isNaN(bp)) {
659
+ bp = 0;
660
+ }
661
+ let ap = Math.abs(a.percent);
662
+ if (Number.isNaN(ap)) {
663
+ ap = 0;
664
665
+ if (bp < ap) {
666
+ return -1;
667
+ } else if (bp > ap) {
668
+ return 1;
669
+ } else {
670
+ return a.name.localeCompare(b.name);
671
672
+ });
673
},
674
before() {
675
if (!this.data) {
0 commit comments