Skip to content

Commit

Permalink
Update utils.ts: Optimize and simplify code
Browse files Browse the repository at this point in the history
Update utils.ts: Optimize and simplify code
  • Loading branch information
aswind7 authored Apr 11, 2024
1 parent e8683d9 commit 5ba16ae
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/astro/src/i18n/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ function sortAndFilterLocales(browserLocaleList: BrowserLocale[], locales: Local
})
.sort((a, b) => {
if (a.qualityValue && b.qualityValue) {
if (a.qualityValue > b.qualityValue) {
return -1;
} else if (a.qualityValue < b.qualityValue) {
return 1;
}
return Math.sign(b.qualityValue - a.qualityValue);
}
return 0;
});
Expand Down

0 comments on commit 5ba16ae

Please sign in to comment.