summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation/commits.go
diff options
context:
space:
mode:
authorEng Zer Jun <engzerjun@gmail.com>2024-04-07 23:24:10 +0800
committerEng Zer Jun <engzerjun@gmail.com>2024-04-07 23:24:10 +0800
commitf933a2f7ec2e0ab280d41a7d1582729c1acab92b (patch)
tree5a71a868efe921c21302d854cdae2f1845c384f5 /pkg/gui/presentation/commits.go
parented61b9a7f2e2ca07643ded8e33a6d38e57f32b22 (diff)
Replace min/max helpers with built-in min/max
We upgraded our minimum Go version to 1.21 in commit 57ac9c2189458a7f0e63c2e9cac8334694a3d545. 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>
Diffstat (limited to 'pkg/gui/presentation/commits.go')
-rw-r--r--pkg/gui/presentation/commits.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go
index 611fdde8c..c5d5e92e8 100644
--- a/pkg/gui/presentation/commits.go
+++ b/pkg/gui/presentation/commits.go
@@ -69,7 +69,7 @@ func GetCommitListDisplayStrings(
}
// this is where my non-TODO commits begin
- rebaseOffset := utils.Min(indexOfFirstNonTODOCommit(commits), endIdx)
+ rebaseOffset := min(indexOfFirstNonTODOCommit(commits), endIdx)
filteredCommits := commits[startIdx:endIdx]
@@ -80,11 +80,11 @@ func GetCommitListDisplayStrings(
if showGraph {
// this is where the graph begins (may be beyond the TODO commits depending on startIdx,
// but we'll never include TODO commits as part of the graph because it'll be messy)
- graphOffset := utils.Max(startIdx, rebaseOffset)
+ graphOffset := max(startIdx, rebaseOffset)
pipeSets := loadPipesets(commits[rebaseOffset:])
- pipeSetOffset := utils.Max(startIdx-rebaseOffset, 0)
- graphPipeSets := pipeSets[pipeSetOffset:utils.Max(endIdx-rebaseOffset, 0)]
+ pipeSetOffset := max(startIdx-rebaseOffset, 0)
+ graphPipeSets := pipeSets[pipeSetOffset:max(endIdx-rebaseOffset, 0)]
graphCommits := commits[graphOffset:endIdx]
graphLines := graph.RenderAux(
graphPipeSets,