chore: use min()/max() builtins (Go 1.21+)
All checks were successful
Security Scan / security (pull_request) Successful in 23s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-02-24 16:27:11 +00:00
parent 63a73a9852
commit 0941ba865f
No known key found for this signature in database
GPG key ID: AF404715446AEB41
2 changed files with 3 additions and 12 deletions

View file

@ -266,10 +266,7 @@ func (f *Frame) viewLocked() string {
footerH = 1
}
}
middleH := h - headerH - footerH
if middleH < 1 {
middleH = 1
}
middleH := max(h-headerH-footerH, 1)
// Render each region
header := f.renderRegionLocked(RegionHeader, w, headerH)
@ -287,10 +284,7 @@ func (f *Frame) viewLocked() string {
rightW = w / 4
}
}
contentW := w - leftW - rightW
if contentW < 1 {
contentW = 1
}
contentW := max(w-leftW-rightW, 1)
left := f.renderRegionLocked(RegionLeft, leftW, middleH)
right := f.renderRegionLocked(RegionRight, rightW, middleH)

View file

@ -288,10 +288,7 @@ func (t *Table) constrainWidths(widths []int) {
}
// Shrink widest columns first until we fit.
budget := t.maxWidth - overhead
if budget < cols {
budget = cols
}
budget := max(t.maxWidth-overhead, cols)
for total-overhead > budget {
maxIdx, maxW := 0, 0
for i, w := range widths {