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 5, 2019
1 parent c377ac8 commit 0ff4006
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion moment-timezone.js
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 0ff4006

Please sign in to comment.