mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-25 12:24:47 +02:00
Cleanup: use slices.Delete to delete elements from a slice
I find this much easier to read.
This commit is contained in:
parent
ec22570eac
commit
f680b6e82e
@ -5,6 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/mattn/go-runewidth"
|
"github.com/mattn/go-runewidth"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
|
"golang.org/x/exp/slices"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Alignment int
|
type Alignment int
|
||||||
@ -82,7 +83,7 @@ outer:
|
|||||||
// remove the columns
|
// remove the columns
|
||||||
for i, strings := range displayStringsArr {
|
for i, strings := range displayStringsArr {
|
||||||
for j := len(toRemove) - 1; j >= 0; j-- {
|
for j := len(toRemove) - 1; j >= 0; j-- {
|
||||||
strings = append(strings[:toRemove[j]], strings[toRemove[j]+1:]...)
|
strings = slices.Delete(strings, toRemove[j], toRemove[j]+1)
|
||||||
}
|
}
|
||||||
displayStringsArr[i] = strings
|
displayStringsArr[i] = strings
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user