1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

make more use of generics

This commit is contained in:
Jesse Duffield
2022-03-19 12:26:30 +11:00
parent dde30fa104
commit c7a629c440
52 changed files with 3013 additions and 274 deletions

View File

@ -1,6 +1,7 @@
package presentation
import (
"github.com/jesseduffield/generics/set"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/gui/style"
"github.com/jesseduffield/lazygit/pkg/theme"
@ -8,7 +9,7 @@ import (
"github.com/kyokomi/emoji/v2"
)
func GetReflogCommitListDisplayStrings(commits []*models.Commit, fullDescription bool, cherryPickedCommitShaMap map[string]bool, diffName string, parseEmoji bool) [][]string {
func GetReflogCommitListDisplayStrings(commits []*models.Commit, fullDescription bool, cherryPickedCommitShaSet *set.Set[string], diffName string, parseEmoji bool) [][]string {
lines := make([][]string, len(commits))
var displayFunc func(*models.Commit, bool, bool, bool) []string
@ -20,7 +21,7 @@ func GetReflogCommitListDisplayStrings(commits []*models.Commit, fullDescription
for i := range commits {
diffed := commits[i].Sha == diffName
cherryPicked := cherryPickedCommitShaMap[commits[i].Sha]
cherryPicked := cherryPickedCommitShaSet.Includes(commits[i].Sha)
lines[i] = displayFunc(commits[i], cherryPicked, diffed, parseEmoji)
}