From eda8f4a5d4302691d99efd066f9851809c984bc0 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 19 Mar 2022 15:36:46 +1100 Subject: lots more generics --- pkg/gui/presentation/graph/graph.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/gui/presentation') 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 -- cgit v1.2.3