forked from toolshed/abra
build: go 1.24
We were running behind and there were quite some deprecations to update. This was mostly in the upstream copy/pasta package but seems quite minimal.
This commit is contained in:
18
vendor/github.com/charmbracelet/lipgloss/table/util.go
generated
vendored
18
vendor/github.com/charmbracelet/lipgloss/table/util.go
generated
vendored
@ -20,7 +20,7 @@ func max(a, b int) int { //nolint:predeclared
|
||||
return b
|
||||
}
|
||||
|
||||
// min returns the greater of two integers.
|
||||
// min returns the smaller of two integers.
|
||||
func min(a, b int) int { //nolint:predeclared
|
||||
if a < b {
|
||||
return a
|
||||
@ -45,20 +45,8 @@ func median(n []int) int {
|
||||
return 0
|
||||
}
|
||||
if len(n)%2 == 0 {
|
||||
h := len(n) / 2 //nolint:gomnd
|
||||
return (n[h-1] + n[h]) / 2 //nolint:gomnd
|
||||
h := len(n) / 2 //nolint:mnd
|
||||
return (n[h-1] + n[h]) / 2 //nolint:mnd
|
||||
}
|
||||
return n[len(n)/2]
|
||||
}
|
||||
|
||||
// largest returns the largest element and it's index from a slice of integers.
|
||||
func largest(n []int) (int, int) { //nolint:unparam
|
||||
var largest, index int
|
||||
for i, e := range n {
|
||||
if n[i] > n[index] {
|
||||
largest = e
|
||||
index = i
|
||||
}
|
||||
}
|
||||
return index, largest
|
||||
}
|
||||
|
Reference in New Issue
Block a user