1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

use array of ints instead of range

This commit is contained in:
Jesse Duffield
2019-11-04 11:46:28 +11:00
parent cc039d1f9b
commit a3c84296bf
3 changed files with 40 additions and 15 deletions

View File

@ -226,6 +226,16 @@ func IncludesString(list []string, a string) bool {
return false
}
// IncludesInt if the list contains the Int
func IncludesInt(list []int, a int) bool {
for _, b := range list {
if b == a {
return true
}
}
return false
}
// NextIndex returns the index of the element that comes after the given number
func NextIndex(numbers []int, currentNumber int) int {
for index, number := range numbers {