mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Replace min/max helpers with built-in min/max
We upgraded our minimum Go version to 1.21 in commit
57ac9c2189
. We can now replace our
`utils.Min` and `utils.Max` functions with the built-in `min` and `max`.
Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@ -79,9 +79,9 @@ func getBranchDisplayStrings(
|
||||
}
|
||||
|
||||
// Don't bother shortening branch names that are already 3 characters or less
|
||||
if len(displayName) > utils.Max(availableWidth, 3) {
|
||||
if len(displayName) > max(availableWidth, 3) {
|
||||
// Never shorten the branch name to less then 3 characters
|
||||
len := utils.Max(availableWidth, 4)
|
||||
len := max(availableWidth, 4)
|
||||
displayName = displayName[:len-1] + "…"
|
||||
}
|
||||
coloredName := nameTextStyle.Sprint(displayName)
|
||||
|
Reference in New Issue
Block a user