diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-19 15:36:46 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-24 20:14:41 +1100 |
commit | eda8f4a5d4302691d99efd066f9851809c984bc0 (patch) | |
tree | 0cb13f767ca52682a62d09314f8d9f2f2c1cd4a1 /pkg/gui/presentation | |
parent | c7a629c4401ae0d4aad06767c88ce1e9e418dbf3 (diff) |
lots more generics
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r-- | pkg/gui/presentation/graph/graph.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/gui/presentation/graph/graph.go b/pkg/gui/presentation/graph/graph.go index 0e193cba8..70ab53079 100644 --- a/pkg/gui/presentation/graph/graph.go +++ b/pkg/gui/presentation/graph/graph.go @@ -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 |