Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Feb 20, 2025
1 parent eb42d4e commit 53d8da5
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions ansi/sixel/palette.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,23 +182,8 @@ func (p *sixelPalette) quantize(uniqueColors []sixelColor, pixelCounts map[sixel
for cubeHeap.Len() < maxColors {
cubeToSplit := heap.Pop(&cubeHeap).(quantizationCube)

// Sort the colors in the bucket's range along the cube's longest color axis
// TODO: Use slices.SortFunc in the future
// sort.SliceStable(uniqueColors[cubeToSplit.startIndex:cubeToSplit.startIndex+cubeToSplit.length],
// func(i, j int) bool {
// slice := uniqueColors[cubeToSplit.startIndex:cubeToSplit.startIndex+cubeToSplit.length]
// switch cubeToSplit.sliceChannel {
// case quantizationRed:
// return slice[i].Red < slice[j].Red
// case quantizationGreen:
// return slice[i].Green < slice[j].Green
// case quantizationBlue:
// return slice[i].Blue < slice[j].Blue
// default:
// return slice[i].Alpha < slice[j].Alpha
// }
// })

// TODO: Use slices.SortFunc and cmp.Compare in the future (>=1.24)
// Then can delete palette_sort.go
sortFunc(uniqueColors[cubeToSplit.startIndex:cubeToSplit.startIndex+cubeToSplit.length],
func(left sixelColor, right sixelColor) int {
switch cubeToSplit.sliceChannel {
Expand Down

0 comments on commit 53d8da5

Please sign in to comment.