diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-19 12:26:30 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-24 20:14:41 +1100 |
commit | c7a629c4401ae0d4aad06767c88ce1e9e418dbf3 (patch) | |
tree | 2ff5599041030a423e02214989f07129772337c6 /pkg/commands/patch/hunk.go | |
parent | dde30fa104347ab9c01f82b7886864b473e6f51c (diff) |
make more use of generics
Diffstat (limited to 'pkg/commands/patch/hunk.go')
-rw-r--r-- | pkg/commands/patch/hunk.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/commands/patch/hunk.go b/pkg/commands/patch/hunk.go index bbb2d54ff..98d932126 100644 --- a/pkg/commands/patch/hunk.go +++ b/pkg/commands/patch/hunk.go @@ -5,6 +5,7 @@ import ( "strings" "github.com/jesseduffield/lazygit/pkg/utils" + "github.com/samber/lo" ) type PatchHunk struct { @@ -54,7 +55,7 @@ func (hunk *PatchHunk) updatedLines(lineIndices []int, reverse bool) []string { if line == "" { break } - isLineSelected := utils.IncludesInt(lineIndices, lineIdx) + isLineSelected := lo.Contains(lineIndices, lineIdx) firstChar, content := line[:1], line[1:] transformedFirstChar := transformedFirstChar(firstChar, reverse, isLineSelected) |