mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
many more generics
This commit is contained in:
@ -1,19 +1,16 @@
|
||||
package presentation
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/generics/slices"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/theme"
|
||||
)
|
||||
|
||||
func GetRemoteBranchListDisplayStrings(branches []*models.RemoteBranch, diffName string) [][]string {
|
||||
lines := make([][]string, len(branches))
|
||||
|
||||
for i := range branches {
|
||||
diffed := branches[i].FullName() == diffName
|
||||
lines[i] = getRemoteBranchDisplayStrings(branches[i], diffed)
|
||||
}
|
||||
|
||||
return lines
|
||||
return slices.Map(branches, func(branch *models.RemoteBranch) []string {
|
||||
diffed := branch.FullName() == diffName
|
||||
return getRemoteBranchDisplayStrings(branch, diffed)
|
||||
})
|
||||
}
|
||||
|
||||
// getRemoteBranchDisplayStrings returns the display string of branch
|
||||
|
Reference in New Issue
Block a user