Skip to content
Merged
Prev Previous commit
Next Next commit
Update comment
  • Loading branch information
philipp-spiess committed Sep 17, 2024
commit 20885f0cd20ef2e3c2dbb0070b69036583adc297
15 changes: 3 additions & 12 deletions packages/tailwindcss/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,20 +325,11 @@ function getPropertySort(nodes: AstNode[]) {

/**
* Sort an array of entries into an array-of-sets. Similar entries (where the
* sort function returns 0) are grouped together. The sort function is stable
* and uses bubble-sort
* sort function returns 0) are grouped together.
*
* Example:
* Example: [a, c, b, A]
*
* [a, c, b, A]
*
* Becomes:
*
* [
* Set[a, A],
* Set[b],
* Set[c],
* ]
* Becomes: [Set[a, A], Set[b], Set[c]]
*/
function sortAndGroup<T>(entries: T[], comparator: (a: T, z: T) => number): Set<T>[] {
let groups: Set<T>[] = []
Expand Down