1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

lots more generics

This commit is contained in:
Jesse Duffield
2022-03-19 15:36:46 +11:00
parent c7a629c440
commit eda8f4a5d4
19 changed files with 384 additions and 299 deletions

View File

@ -2,10 +2,10 @@ package graph
import (
"runtime"
"sort"
"strings"
"sync"
"github.com/jesseduffield/generics/slices"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/gui/style"
"github.com/jesseduffield/lazygit/pkg/utils"
@ -265,11 +265,11 @@ func getNextPipes(prevPipes []*Pipe, commit *models.Commit, getStyle func(c *mod
}
// not efficient but doing it for now: sorting my pipes by toPos, then by kind
sort.Slice(newPipes, func(i, j int) bool {
if newPipes[i].toPos == newPipes[j].toPos {
return newPipes[i].kind < newPipes[j].kind
slices.SortFunc(newPipes, func(a, b *Pipe) bool {
if a.toPos == b.toPos {
return a.kind < b.kind
}
return newPipes[i].toPos < newPipes[j].toPos
return a.toPos < b.toPos
})
return newPipes