chore(lint): remove custom min and max functions

These are now available as builtins.
This commit is contained in:
Andrey Nering
2025-03-20 10:42:52 -03:00
parent 76433f7143
commit fff86382cc
8 changed files with 9 additions and 102 deletions
+6 -20
View File
@@ -853,13 +853,13 @@ func (m Model) LineInfo() LineInfo {
// repositionView repositions the view of the viewport based on the defined
// scrolling behavior.
func (m *Model) repositionView() {
min := m.viewport.YOffset
max := min + m.viewport.Height - 1
minimum := m.viewport.YOffset
maximum := minimum + m.viewport.Height - 1
if row := m.cursorLineNumber(); row < min {
m.viewport.LineUp(min - row)
} else if row > max {
m.viewport.LineDown(row - max)
if row := m.cursorLineNumber(); row < minimum {
m.viewport.LineUp(minimum - row)
} else if row > maximum {
m.viewport.LineDown(row - maximum)
}
}
@@ -1466,17 +1466,3 @@ func clamp(v, low, high int) int {
}
return min(high, max(low, v))
}
func min(a, b int) int {
if a < b {
return a
}
return b
}
func max(a, b int) int {
if a > b {
return a
}
return b
}