diff --git a/src/routes/profile/DomainsTable.svelte b/src/routes/profile/DomainsTable.svelte index c42bda5a..46d60444 100644 --- a/src/routes/profile/DomainsTable.svelte +++ b/src/routes/profile/DomainsTable.svelte @@ -29,9 +29,10 @@ function handleSort() { domains.sort((a, b) => { - const [aVal, bVal] = [a[sort], b[sort]][ - sortDirection === 'ascending' ? 'slice' : 'reverse' - ](); + // Bolt optimization: Avoid creating and slicing/reversing arrays in sort comparator + // to reduce O(N log N) garbage collection overhead + const aVal = sortDirection === 'ascending' ? a[sort] : b[sort]; + const bVal = sortDirection === 'ascending' ? b[sort] : a[sort]; if (typeof aVal === 'string' && typeof bVal === 'string') return aVal.localeCompare(bVal); return Number(aVal) - Number(bVal); });