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:
@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
"github.com/samber/lo"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@ -140,7 +139,7 @@ func (self *FileTree) GetAllItems() []*FileNode {
|
||||
|
||||
func (self *FileTree) Len() int {
|
||||
// -1 because we're ignoring the root
|
||||
return utils.Max(self.tree.Size(self.collapsedPaths)-1, 0)
|
||||
return max(self.tree.Size(self.collapsedPaths)-1, 0)
|
||||
}
|
||||
|
||||
func (self *FileTree) GetItem(index int) types.HasUrn {
|
||||
|
Reference in New Issue
Block a user