Fixed #4285 - Locale performance updates with large datasets

This commit is contained in:
Tuğçe Küçükoğlu 2023-08-17 15:42:07 +03:00
parent 961ba354f5
commit 99d77616af
5 changed files with 7 additions and 6 deletions

View file

@ -119,7 +119,7 @@ export default {
if (value1 == null && value2 != null) result = -1;
else if (value1 != null && value2 == null) result = 1;
else if (value1 == null && value2 == null) result = 0;
else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, undefined, { numeric: true });
else if (typeof value1 === 'string' && typeof value2 === 'string') result = new Intl.Collator(undefined, { numeric: true }).compare(value1, value2);
else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
return this.sortOrder * result;