Skip to content

Commit

Permalink
fix: stabilize Array.sort
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRuf authored and ellenaua committed Jul 6, 2019
1 parent c377ac8 commit da5af24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion moment-timezone.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@
if (a.abbrScore !== b.abbrScore) {
return a.abbrScore - b.abbrScore;
}
return b.zone.population - a.zone.population;
if (a.zone.population !== b.zone.population) {
return b.zone.population - a.zone.population;
}
return b.zone.name.localeCompare(a.zone.name);
}

function addToGuesses (name, offsets) {
Expand Down

0 comments on commit da5af24

Please sign in to comment.