mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Standardise on using lo for slice functions
We've been sometimes using lo and sometimes using my slices package, and we need to pick one for consistency. Lo is more extensive and better maintained so we're going with that. My slices package was a superset of go's own slices package so in some places I've just used the official one (the methods were just wrappers anyway). I've also moved the remaining methods into the utils package.
This commit is contained in:
@ -4,12 +4,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/jesseduffield/generics/set"
|
||||
"github.com/jesseduffield/generics/slices"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/style"
|
||||
"github.com/jesseduffield/lazygit/pkg/theme"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
"github.com/kyokomi/emoji/v2"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
func GetReflogCommitListDisplayStrings(commits []*models.Commit, fullDescription bool, cherryPickedCommitShaSet *set.Set[string], diffName string, now time.Time, timeFormat string, shortTimeFormat string, parseEmoji bool) [][]string {
|
||||
@ -20,7 +20,7 @@ func GetReflogCommitListDisplayStrings(commits []*models.Commit, fullDescription
|
||||
displayFunc = getDisplayStringsForReflogCommit
|
||||
}
|
||||
|
||||
return slices.Map(commits, func(commit *models.Commit) []string {
|
||||
return lo.Map(commits, func(commit *models.Commit, _ int) []string {
|
||||
diffed := commit.Sha == diffName
|
||||
cherryPicked := cherryPickedCommitShaSet.Includes(commit.Sha)
|
||||
return displayFunc(commit,
|
||||
|
Reference in New Issue
Block a user