mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02: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:
parent
ed61b9a7f2
commit
f933a2f7ec
12 changed files with 20 additions and 73 deletions
|
@ -457,9 +457,9 @@ func (self *LocalCommitsController) drop(selectedCommits []*models.Commit, start
|
|||
}
|
||||
|
||||
if selectedIdx > rangeStartIdx {
|
||||
selectedIdx = utils.Max(selectedIdx-len(updateRefTodos), rangeStartIdx)
|
||||
selectedIdx = max(selectedIdx-len(updateRefTodos), rangeStartIdx)
|
||||
} else {
|
||||
rangeStartIdx = utils.Max(rangeStartIdx-len(updateRefTodos), selectedIdx)
|
||||
rangeStartIdx = max(rangeStartIdx-len(updateRefTodos), selectedIdx)
|
||||
}
|
||||
|
||||
self.context().SetSelectionRangeAndMode(selectedIdx, rangeStartIdx, rangeSelectMode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue