mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Update utils.ts: Optimize and simplify code (#10749)
Update utils.ts: Optimize and simplify code
This commit is contained in:
parent
7e825604dd
commit
f1bc3dea92
1 changed files with 1 additions and 5 deletions
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue