Skip to content

Commit

Permalink
chore: optimized sort logic
Browse files Browse the repository at this point in the history
Co-authored-by: Lars Trieloff <[email protected]>
  • Loading branch information
asthabh23 and trieloff authored Dec 4, 2024
1 parent 62ee81f commit ad690cf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions distiller.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,7 @@ export class DataChunks {
}, new Map());

// Find the most occurring cluster
let mostOccurringCluster = null;
const sortedClusters = [...clusterMap.entries()].sort((a, b) => b[1] - a[1]);
if (sortedClusters.length > 0) {
mostOccurringCluster = sortedClusters[0];
}
const [mostOccurringCluster] = [...clusterMap.entries()].sort((a, b) => b[1] - a[1]);

// Calculate the total number of items in the superset cluster
const totalItemsInSupersetCluster = Math.floor(facetValues.length + clustercount);
Expand Down

0 comments on commit ad690cf

Please sign in to comment.